mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When matchTypes is trying to match up instances of the same generic type for a Conversion or Construction constraint, it isn't an error for the generic types not to be recursively the same, because a constructor or conversion operator may be available between different instances of the type. Fixes <rdar://problem/13140447>. Swift SVN r3938
23 lines
373 B
Swift
23 lines
373 B
Swift
// RUN: %swift -parse -verify -constraint-checker %s
|
|
|
|
struct G<T> {
|
|
constructor<U>(x:G<U>) { }
|
|
|
|
func foo<U>(x:G<U>) { }
|
|
|
|
func bar<U>(x:U) { }
|
|
|
|
static func static_foo<U>(x:G<U>) { }
|
|
static func static_bar<U>(x:U) { }
|
|
}
|
|
|
|
typealias GInt = G<Int>
|
|
typealias GChar = G<Char>
|
|
GInt(GChar())
|
|
|
|
GInt().foo(GChar())
|
|
GInt().bar(0)
|
|
|
|
GInt.static_foo(GChar())
|
|
GInt.static_bar(0)
|