Hopefully this is the right mailing list...
It seems like there’s currently no way to declare a type that is an object
conforming to a protocol in Swift, and I think that would be a useful language
feature to add.
To be super clear about what I mean, if I have the following code:
class MyClass {
…
}
protocol MyProtocol {
…
}
There is currently no way to do something like (in pseudo-code):
var thing: MyClass & MyProtocol = …
In Objective-C, you would do:
MyClass <MyProtocol> *thing ...
Is this up for consideration, or is there a reason why this isn’t possible?
Thanks.
Richard
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution