mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
If unqualified name lookup finds an associated type, but resolution to the type witness fails, produce a diagnostic rather than silently failing. Fixes the crash in SR-5825, SR-5881, and SR-5905. It's conceivable that we could resolve this with suitably global associated type inference... but that's far off and it's best not to crash until then.
17 lines
343 B
Swift
17 lines
343 B
Swift
// RUN: not %target-swift-frontend %s -emit-ir
|
|
|
|
struct DefaultAssociatedType {
|
|
}
|
|
|
|
protocol Protocol {
|
|
associatedtype AssociatedType = DefaultAssociatedType
|
|
init(object: AssociatedType)
|
|
}
|
|
|
|
final class Conformance: Protocol {
|
|
private let object: AssociatedType
|
|
init(object: AssociatedType) {
|
|
self.object = object
|
|
}
|
|
}
|