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
@@ -0,0 +1,22 @@
// !CHECK_TYPE
// FILE: Clazz.java
public class Clazz<T> {
public T getT() { return null; }
public Clazz<? super T> getSuperClass() { return null; }
}
// FILE: main.kt
fun test(clazz: Clazz<*>) {
clazz.t checkType { _<Any?>() }
clazz.getSuperClass() checkType { _<Clazz<*>?>() }
clazz.getSuperClass().t checkType { _<Any?>() }
clazz.superClass checkType { _<Clazz<*>?>() }
clazz.superClass.t checkType { _<Any?>() }
// See KT-9294
if (clazz.superClass == null) {
throw NullPointerException()
}
}