I am sure this is the same deep question that was discussed in detail at https://bugs.swift.org/browse/SR-55 . Think that this compiles and runs just fine:
class Person : NSObject {}
@objc protocol Parent where Self: Person {
func speak()
}
class GrandMotherPerson: Person, Parent {
func speak() {
print("I am a Grandmother Person")
}
}
let gmp = GrandMotherPerson()
let parent = gmp as Parent
parent.speak()
But now delete @objc
, and we will get the same problem as yours:
class Person : NSObject {}
protocol Parent where Self: Person {
func speak()
}
class GrandMotherPerson: Person, Parent {
func speak() {
print("I am a Grandmother Person")
}
}
let gmp = GrandMotherPerson()
let parent = gmp as Parent
parent.speak()
, , Swift , . @objc
, .
. , , , (gmp as Parent).speak()
- , , .