mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Usually this happens directly, through some use of the class and its conformance. However, if a conformance is /only/ used to satisfy an associated type, we seem to bypass the step that actually infers selector names for accessors, even though we do it successfully for methods. Fix this by making sure the accessor decls are validated when a property is, something that normal uses of a property probably have to do anyway. Also, simplify inferObjCName by assuming/asserting that it is only used on things that are already marked @objc. https://bugs.swift.org/browse/SR-6944
15 lines
449 B
Swift
15 lines
449 B
Swift
// RUN: %target-swift-frontend -typecheck -primary-file %s %S/Inputs/sr9644-helper.swift -import-objc-header %S/Inputs/sr9644.h -verify
|
|
|
|
// REQUIRES: objc_interop
|
|
// expected-no-warning
|
|
|
|
protocol HasAssoc {
|
|
associatedtype Assoc: TestProto
|
|
}
|
|
|
|
struct Impl: HasAssoc {
|
|
// This used to trigger validation of the Test: TestProto conformance, but
|
|
// /without/ propagating the correct selector onto Test.swiftFoo's getter.
|
|
typealias Assoc = Test
|
|
}
|