Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0131-sr6466.swift
Doug Gregor 9554e61705 [AST] Fix a crash when conformance lookup fails during substitution.
The enclosing conformance-lookup operation can fail (i.e., it returns
Optional), but the nested call was force-unwrapping the optional from
an inner call for no particular reason. Stop doing that, which fixes
SR-6466.

Note that the offending code is still something that should go away in
time, so this is merely polishing the band-aid to avoid a crash that
occurs often with conditional conformances.
2017-11-24 23:18:11 -08:00

29 lines
316 B
Swift

// RUN: not %target-swift-frontend %s -typecheck
protocol DC {
init()
}
protocol P {
associatedtype A: DC
func f() -> A
}
protocol Q: P {
associatedtype A
}
extension Q {
func f() -> A { return A() }
}
struct X<T> { }
extension X: P where T: P {
typealias A = T.A
}
extension X: Q where T: Q {
}