mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Since we have `repairViaOptionalUnwrap`, let's use that to fix argument/parameter mismatches instead of doing ad-hoc matching.
13 lines
297 B
Swift
13 lines
297 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@-1 {{global function 'foo' requires that 'Never' conform to 'P'}}
|