[FIR] Don't lose flexible types during capturing from expression

This commit is contained in:
Dmitriy Novozhilov
2022-11-22 13:13:37 +02:00
committed by Space Team
parent 06e88b559a
commit eb8ce449e3
11 changed files with 69 additions and 40 deletions
@@ -1,22 +0,0 @@
// !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 { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Clazz<*>?>() }
clazz.getSuperClass().t checkType { _<Any?>() }
clazz.superClass checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Clazz<*>?>() }
clazz.superClass.t checkType { _<Any?>() }
// See KT-9294
if (clazz.superClass == null) {
throw NullPointerException()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
// FILE: Clazz.java