IDE: Don't add this!! in AddExclExclCallFix for nullable member

access in extension function.

^KTIJ-10052 Fixed
This commit is contained in:
Mark Punzalan
2021-04-23 05:02:06 +00:00
committed by Ilya Kirillov
parent c0fbdb1535
commit c472c9facd
13 changed files with 113 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
// "Add non-null asserted (!!) call" "true"
// WITH_RUNTIME
fun foo(a: List<String>?) {
for (s in <caret>a) {}
}
@@ -0,0 +1,6 @@
// "Add non-null asserted (!!) call" "true"
// WITH_RUNTIME
fun foo(a: List<String>?) {
for (s in a!!) {}
}
@@ -0,0 +1,11 @@
// "Add non-null asserted (!!) call" "true"
// WITH_RUNTIME
class C {
val list: List<String>? = null
}
// Test for KTIJ-10052
fun C.test() {
for (s in <caret>list) {}
}
@@ -0,0 +1,11 @@
// "Add non-null asserted (!!) call" "true"
// WITH_RUNTIME
class C {
val list: List<String>? = null
}
// Test for KTIJ-10052
fun C.test() {
for (s in list!!) {}
}