[FIR] Add regression test for KT-44392
Also related to KT-56615
This commit is contained in:
committed by
Space Team
parent
197f19c627
commit
019d7db737
+9
@@ -0,0 +1,9 @@
|
||||
FILE: redundantNullCheckOnAsCast.kt
|
||||
public final fun test_1(a: R|kotlin/Any?|): R|kotlin/Unit| {
|
||||
(R|<local>/a| as R|kotlin/String?|)!!
|
||||
(R|<local>/a| as? R|kotlin/String|)!!
|
||||
}
|
||||
public final fun test_2(a: R|kotlin/Any?|): R|kotlin/Unit| {
|
||||
(R|<local>/a| as R|kotlin/String?|)!!
|
||||
R|<local>/a|!!
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// ISSUE: KT-44392, KT-56615
|
||||
|
||||
fun test_1(a: Any?) {
|
||||
(a as String?)!!
|
||||
(a as? String)!!
|
||||
}
|
||||
|
||||
fun test_2(a: Any?) {
|
||||
(a as String?)!!
|
||||
a<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
}
|
||||
Reference in New Issue
Block a user