KT-4820: Intention to introduce an index variable to a for loop over an ordered collection via "withIndices()."
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
//IS_APPLICABLE: FALSE
|
||||
//ERROR: Unresolved reference: withIndices
|
||||
fun b(c: List<String>) {
|
||||
for ((<caret>indexVariable, d) in c.withIndices()) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: FALSE
|
||||
// ERROR: For-loop range must have an iterator() method
|
||||
fun foo(bar: Map<String, String>) {
|
||||
for (a <caret>in bar) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// ERROR: Unresolved reference: listOf
|
||||
fun a() {
|
||||
val b = listOf(1,2,3,4,5)
|
||||
for (<caret>c : Int in b) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// ERROR: Unresolved reference: listOf
|
||||
fun a() {
|
||||
val b = listOf(1,2,3,4,5)
|
||||
for ((index, c : Int) in b.withIndices()) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// ERROR: Unresolved reference: listOf
|
||||
fun a() {
|
||||
val b = listOf(1,2,3,4,5)
|
||||
for (<caret>c in b) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// ERROR: Unresolved reference: listOf
|
||||
fun a() {
|
||||
val b = listOf(1,2,3,4,5)
|
||||
for ((index, c) in b.withIndices()) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
//ERROR: Unresolved reference: SortedMap
|
||||
fun a(b: SortedMap<Int, String>) {
|
||||
for (<caret>c in b) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
//ERROR: Unresolved reference: SortedMap
|
||||
fun a(b: SortedMap<Int, String>) {
|
||||
for ((index, c) in b.withIndices()) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user