mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
As an optimization, we don't even look for associated types in @objc protocols. However, this could lead to broken invariants like "every associated type has a witness" in ill-formed @objc protocols that do have associated types. Implement this optimization by checking whether the protocol has a Clang node. Fixes rdar://problem/41425828 / SR-8094.
15 lines
230 B
Swift
15 lines
230 B
Swift
// RUN: not %target-swift-frontend -typecheck %s
|
|
|
|
@objc protocol Foo {
|
|
associatedtype Bar
|
|
var property: Generic<Bar> { get }
|
|
}
|
|
|
|
class Generic<Element> {
|
|
}
|
|
|
|
class FooImpl<T>: NSObject, Foo {
|
|
let property: Generic<T>
|
|
}
|
|
|