mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Let's make use of a newly added "disable for performance" flag to allow solver to consider overload choices where the only issue is missing one or more labels - this makes it for a much better diagnostic experience without any performance impact for valid code.
16 lines
488 B
Swift
16 lines
488 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
struct Foo<T, U> { // expected-note {{incorrect labels for candidate (have: '(_:)', expected: '(value:)')}}
|
|
var value: U
|
|
func bar() -> Foo<T, U> {
|
|
return Foo(value)
|
|
// expected-error@-1 {{no exact matches in call to initializer}}
|
|
}
|
|
}
|
|
|
|
extension Foo where T == U { // expected-note {{candidate requires that the types 'T' and 'U' be equivalent (requirement specified as 'T' == 'U')}}
|
|
init(_ value: U) {
|
|
self.value = value
|
|
}
|
|
}
|