This works:
protocol Inconceivable {
associatedtype AbstractType
func say(it: AbstractType)
}
class Vizzini: Inconceivable {
func say(theWord: String) {
print(theWord)
}
}
Vizzini().say("Inconceivable!")
However, modifying the protocol to use optional prefix:
@objc protocol Inconceivable {
associatedtype AbstractType
optional func say(it: AbstractType)
}
It doesn't work anymore:
error: method cannot be a member of an @objc protocol because the type of the parameter cannot be represented in Objective-C optional func say(it: AbstractType)
Is there a workaround?