FIR checker: report expression of nullable type parameter as LHS of class literals
This commit is contained in:
committed by
Mikhail Glukhikh
parent
26441ed64f
commit
4c08d10cce
-15
@@ -1,15 +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 = t::class
|
||||
fun <S : String?> f3(s: S): Any = 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!>c[0]<!>::class
|
||||
|
||||
fun f6(j: J): Any = j.platformString()::class
|
||||
+2
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: J.java
|
||||
|
||||
public interface J {
|
||||
@@ -8,6 +9,7 @@ public interface J {
|
||||
|
||||
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!>c[0]<!>::class
|
||||
|
||||
+1
@@ -2,6 +2,7 @@ package
|
||||
|
||||
public fun f1(/*0*/ x: kotlin.Int?): kotlin.Any
|
||||
public fun </*0*/ T> f2(/*0*/ t: T): kotlin.Any
|
||||
public fun </*0*/ T> f21(/*0*/ t: T): kotlin.Any where T : kotlin.Comparable<T>
|
||||
public fun </*0*/ S : kotlin.String?> f3(/*0*/ s: S): kotlin.Any
|
||||
public fun </*0*/ U : kotlin.Any> f4(/*0*/ u: U?): kotlin.Any
|
||||
public fun f5(/*0*/ c: kotlin.collections.List<*>): kotlin.Any
|
||||
|
||||
Reference in New Issue
Block a user