val / var are now forbidden on a loop multi declaration parameter #KT-6274 Fixed
VAL_OR_VAR_ON_LOOP_MULTI_PARAMETER error added KtValVarKeywordOwner interface added for PSIs that have getValOrVarKeyword method
This commit is contained in:
committed by
Mikhail Glukhikh
parent
54cb575819
commit
141ffa27dc
@@ -1,3 +1,18 @@
|
||||
class Pair {
|
||||
operator fun component1(): Int = null!!
|
||||
operator fun component2(): Int = null!!
|
||||
}
|
||||
|
||||
class Coll {
|
||||
operator fun iterator(): It = It()
|
||||
}
|
||||
|
||||
class It {
|
||||
operator fun next() = Pair()
|
||||
operator fun hasNext() = false
|
||||
}
|
||||
|
||||
|
||||
fun f() {
|
||||
for (<!VAL_OR_VAR_ON_LOOP_PARAMETER!>val<!> i in 1..4) {
|
||||
|
||||
@@ -6,4 +21,12 @@ fun f() {
|
||||
for (<!VAL_OR_VAR_ON_LOOP_PARAMETER!>var<!> i in 1..4) {
|
||||
|
||||
}
|
||||
|
||||
for (<!VAL_OR_VAR_ON_LOOP_MULTI_PARAMETER!>val<!> (i,j) in Coll()) {
|
||||
|
||||
}
|
||||
|
||||
for (<!VAL_OR_VAR_ON_LOOP_MULTI_PARAMETER!>var<!> (i,j) in Coll()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user