mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
are not equal when part of a type requirement. This allows the SkipSameTypeRequirement constraint fix to be applied instead.
16 lines
377 B
Swift
16 lines
377 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
struct Foo<T, U> {
|
|
var value: U
|
|
func bar() -> Foo<T, U> {
|
|
return Foo(value)
|
|
// expected-error@-1 {{referencing initializer 'init(_:)' on 'Foo' requires the types 'T' and 'U' be equivalent}}
|
|
}
|
|
}
|
|
|
|
extension Foo where T == U { // expected-note {{where 'T' = 'T', 'U' = 'U'}}
|
|
init(_ value: U) {
|
|
self.value = value
|
|
}
|
|
}
|