Files
swift-mirror/test/Constraints/nested_generics.swift
Joe Groff a0ad52a2db Constraints: Don't bail on generic conversions.
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
2013-02-02 23:35:43 +00:00

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)