OK... so let me try again. I have an OO class graph such that:
base class is Element
Parent extends Element
Parametric extends Parent
Element, Parent, and Parametric each serve as base classes for various specialized elements.
Some of these specializations are Queryable.
The nearest common base class of Queryable Elements is Element
Not all subclasses of Element are Queryable.
"a. But you were ready to do exactly that in creating a protocol called Queryable."
No, I want to describe specific functionality that is common to Queryable types, some of which happen to be Element subclasses (and some of which derrive from other base types).
"b. But you were ready to do exactly that in creating a base class called Element."
No, Element implements a fairly complex base model type that contains a fair amount of business logic specific to Element-ness that is shared by all Elements, and that already exists, and generally has nothing to do with Queryable-ness.
So, if I have to describe this Element-ness in a protocol, I wind up copying and pasting a whole bunch of code/declarations that already exist into a protocol. And since protocols A) can't have storage, and B) lose the ability to be treated as Types under various conditions, I can't move it into the protocol, because Element is a model, and stores a fair bit of data & state, and needs to be a fully-fledged Type for a variety of applications within the business logic.
This is my biggest issue currently with Swift, is that to do things "correctly" still requires a great deal of duplication of code just to make the compiler happy.
The fact is that I can easily model this in Swift by applying the Queryable protocol to specific classes in the Element type graph, but it seems that I can't qualify a function argument with the combination of Type and Protocol conformance. There's no reason why I shouldn't be able to tell the compiler exactly what I'm passing into the function and avoid the inference in this case just like one can do with optionals or with type casting, except that the language inexplicably doesn't allow qualification by Type<Protocol>. Since you can qualify by Type, or Protocol, or <ProtocolA, ProtocolB>, I don't see why its anything other than a language gap that I can't do Type<Protocol>.
As I said... frustrating.
Anyway, I have a work-around for now, but its quite ugly, and definitely smells ;(