Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0124-sr5825.swift
Doug Gregor d12dbf99ea [Type checker] Diagnose failed attempts to resolve associated type witnesses.
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.
2017-10-03 21:59:14 -07:00

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
}
}