substitute upper bounds after creating all substitutions for type parameters

(otherwise it doesn't work for forward references)
This commit is contained in:
Svetlana Isakova
2013-01-18 17:47:04 +04:00
parent 8f59172f27
commit ff01fad3cd
2 changed files with 8 additions and 4 deletions
@@ -4,7 +4,7 @@ fun foo<V : U, U>(<!UNUSED_PARAMETER!>v<!>: V, u: U) = u
fun bar<U, V : U>(<!UNUSED_PARAMETER!>v<!>: V, u: U) = u
fun test(a: Any, s: String) {
val <!UNUSED_VARIABLE!>b<!>: Any = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED!>foo<!>(a, s) //depends on type parameter order, will be fixed in next commit
val <!UNUSED_VARIABLE!>b<!>: Any = foo(a, s)
val <!UNUSED_VARIABLE!>c<!>: Any = bar(a, s)
}