Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0158-rdar40165062.swift
Pavel Yaskevich f36ecf2fa1 [CSSimplify] Allow overload choices with missing labels to be considered for diagnostics
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.
2021-04-28 12:04:57 -07:00

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