Do you allow to use the intention only if the resulting code will be green? In that case, I'm not sure what's wrong, but it's still applicable whenever there are errors in the initial code, e.g.
```
fun foo() {
    for (a in b) { // <-- still applicable here, although 'b' is unresolved
    }
}
```