FIR: Fix incorrect inference errors for <expr>::class

Do not use outer expect type for <expr>
This commit is contained in:
Denis.Zharkov
2021-11-15 16:19:45 +03:00
committed by teamcityserver
parent 3ec7866ead
commit 07440ee4a1
4 changed files with 7 additions and 22 deletions
@@ -1,16 +0,0 @@
// FILE: J.java
public interface J {
String platformString();
}
// FILE: test.kt
fun f1(x: Int?): Any = <!EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS!>x<!>::class
fun <T> f2(t: T): Any = <!EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS!>t<!>::class
fun <T> f21(t: T): Any where T : Any?, T : Comparable<T> = t::class
fun <S : String?> f3(s: S): Any = <!EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS!>s<!>::class
fun <U : Any> f4(u: U?): Any = <!EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS!>u<!>::class
fun f5(c: List<*>): Any = <!EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS, TYPE_MISMATCH!>c[0]<!>::class
fun f6(j: J): Any = j.platformString()::class
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: J.java
public interface J {