FIR: Fix incorrect inference errors for <expr>::class
Do not use outer expect type for <expr>
This commit is contained in:
committed by
teamcityserver
parent
3ec7866ead
commit
07440ee4a1
-16
@@ -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
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: J.java
|
||||
|
||||
public interface J {
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ val <T> <!KCLASS_WITH_NULLABLE_TYPE_PARAMETER_IN_SIGNATURE!>test4<!> get() = T::
|
||||
|
||||
fun <T> test5() = listOf(T::class)
|
||||
|
||||
fun <T> test6(): kotlin.reflect.KClass<<!UPPER_BOUND_VIOLATED!>T<!>> = <!TYPE_MISMATCH!>T<!>::class
|
||||
fun <T> test7(): kotlin.reflect.KClass<*> = <!TYPE_MISMATCH!>T<!>::class
|
||||
fun <T> test6(): kotlin.reflect.KClass<<!UPPER_BOUND_VIOLATED!>T<!>> = T::class
|
||||
fun <T> test7(): kotlin.reflect.KClass<*> = T::class
|
||||
fun test8() = <!NULLABLE_TYPE_IN_CLASS_LITERAL_LHS!>String?::class<!>
|
||||
|
||||
fun <T> test9() where T : Any?, T : Comparable<T> = T::class
|
||||
|
||||
Reference in New Issue
Block a user