FIR IDE: Offer AddExclExclCallFix for nullable types with an

`iterator()` function that does NOT have `operator` modifier.

This is different from FE1.0. Adding `!!` will then surface the error
that `operator` modifier needs to be added (with corresponding fix).
This commit is contained in:
Mark Punzalan
2021-05-01 05:33:45 +00:00
committed by Ilya Kirillov
parent 9e01a608b2
commit 1d9247ae0f
3 changed files with 24 additions and 2 deletions
@@ -0,0 +1,10 @@
// "Add non-null asserted (!!) call" "true"
class Some {
fun iterator(): Iterator<Int> = null!!
}
fun foo() {
val test: Some? = Some()
for (i in <caret>test) { }
}
@@ -0,0 +1,10 @@
// "Add non-null asserted (!!) call" "true"
class Some {
fun iterator(): Iterator<Int> = null!!
}
fun foo() {
val test: Some? = Some()
for (i in test!!) { }
}