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:
committed by
Ilya Kirillov
parent
9e01a608b2
commit
1d9247ae0f
@@ -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!!) { }
|
||||
}
|
||||
Reference in New Issue
Block a user