print("Nada is Some? \(x is Some)")
print("Nada is Base? \(x is Base)")
There are two statements in the docs on @objc attribute:
a) The compiler also implicitly adds the objc attribute to a class that
inherits from another class marked with the objc attribute or a class
defined in Objective-C.
b) Protocols marked with the objc attribute can’t inherit from protocols
that aren’t.
But they don't spec the other way round about protocols.
Currently the output is
swift main.swift
Nada is Some? true
Nada is Base? false
Hi, Pavel. This is definitely supported, and it is indeed a bug that these are not both producing 'true'. We're tracking this as rdar://problem/24453316 <rdar://problem/24453316>.
Jordan
···
On Feb 5, 2017, at 03:14, Pavel Ivashkov via swift-users <swift-users@swift.org> wrote:
Hello,
What is the current view on inheriting non-objc protocol from objc protocol? Is it supported? Is it a valid construct?
print("Nada is Some? \(x is Some)")
print("Nada is Base? \(x is Base)")
There are two statements in the docs on @objc attribute:
a) The compiler also implicitly adds the objc attribute to a class that inherits from another class marked with the objc attribute or a class defined in Objective-C.
b) Protocols marked with the objc attribute can’t inherit from protocols that aren’t.
But they don't spec the other way round about protocols.
Currently the output is
swift main.swift
Nada is Some? true
Nada is Base? false
On Feb 6, 2017, at 3:22 PM, Jordan Rose via swift-users <swift-users@swift.org> wrote:
Hi, Pavel. This is definitely supported, and it is indeed a bug that these are not both producing 'true'. We're tracking this as rdar://problem/24453316 <rdar://problem/24453316>.