[FIR] Make type of safe call always nullable
^KT-46860 In Progress
This commit is contained in:
committed by
teamcityserver
parent
f18e38a49f
commit
09994ee8ea
+4
-4
@@ -8,13 +8,13 @@ interface A {
|
||||
fun takeInt(x: Int) {}
|
||||
|
||||
fun test_1(a: A) {
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!>
|
||||
takeInt(x) // should be an error
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!>
|
||||
takeInt(<!ARGUMENT_TYPE_MISMATCH!>x<!>) // should be an error
|
||||
}
|
||||
|
||||
fun test_2(a: A?) {
|
||||
if (a != null) {
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!>
|
||||
takeInt(x) // should be an error
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!>
|
||||
takeInt(<!ARGUMENT_TYPE_MISMATCH!>x<!>) // should be an error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user