Fix captured approximation for case of flexible types

#KT-9294 Fixed
This commit is contained in:
Denis Zharkov
2015-12-23 12:35:38 +03:00
parent b6edddbe8b
commit 397d2ca312
7 changed files with 75 additions and 10 deletions
@@ -16,14 +16,12 @@ fun test1(clazz: Class<out Int>) {
val foo0: Class<out Int> = A.foo(clazz)
val foo1 = A.foo(clazz)
foo1 checkType { _< Class<out Int> >() }
// should be ok
foo1 checkType { <!TYPE_MISMATCH!>_<!>< Class<out Int?> >() }
foo1 checkType { _< Class<out Int?> >() }
}
fun tes2t(clazz: Class<in Int>) {
val foo0: Class<out Class<in Int>> = A.bar(clazz)
val foo1 = A.bar(clazz)
foo1 checkType { _< Class<out Class<in Int>> >() }
// should be ok
foo1 checkType { <!TYPE_MISMATCH!>_<!>< Class<out Class<in Int?>> >() }
foo1 checkType { _< Class<out Class<in Int?>> >() }
}