Files
swift-mirror/test/Constraints/rdar44770297.swift
Pavel Yaskevich 5f328ad003 [ConstraintSystem] Don't increase SK_Fix score when looking through holes
`SK_Fix` was used to indicate that solver has encountered a hole
along the current path but since there is `SK_Hole` now, increasing
`SK_Fix` no longer makes sense.
2020-03-25 09:34:00 -07:00

15 lines
481 B
Swift

// RUN: %target-typecheck-verify-swift
protocol P {
associatedtype A
}
func foo<T: P>(_: () throws -> T) -> T.A? { // expected-note {{where 'T' = 'Never'}}
fatalError()
}
let _ = foo() {fatalError()} & nil // expected-error {{global function 'foo' requires that 'Never' conform to 'P'}}
// expected-error@-1 {{value of optional type 'Never.A?' must be unwrapped to a value of type 'Never.A'}}
// expected-note@-2 {{force-unwrap}}
// expected-note@-3 {{coalesce using '??'}}