Files
swift-mirror/test/Constraints/rdar44770297.swift
Pavel Yaskevich b12d844fcc [CSSimplify] Remove ad-hoc optional mismatch handling for arguments
Since we have `repairViaOptionalUnwrap`, let's use that to fix
argument/parameter mismatches instead of doing ad-hoc matching.
2025-05-30 09:52:57 -07:00

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