Files
kotlin-fork/idea/testData/quickfix/addExclExclCall/iterableWithBadIterator.kt
T
Mark Punzalan efa3bf9c69 FIR IDE: Consolidate tests for AddExclExclFix in one directory.
I found these tests only _after_ the previous changes, so I needed to
merge and/or remove redundant tests.
2021-05-20 20:32:57 +02:00

14 lines
352 B
Kotlin
Vendored

// "Add non-null asserted (!!) call" "false"
// ACTION: Replace with a 'forEach' function call
// ACTION: Surround with null check
// ERROR: Not nullable value required to call an 'iterator()' method on for-loop range
class Some {
fun iterator(): Iterator<Int> = null!!
}
fun foo() {
val test: Some? = Some()
for (i in <caret>test) { }
}