Files
kotlin/compiler/testData/checkLocalVariablesTable/destructuringInFor.kt
Mads Ager 3b2843fe7a Introduce local variable type checker.
CheckLocalVariablesTableTests will now check the validity of
the locals table against types of locals computed based on the
bytecode.

These checks and the new destructuringInFor test act as a
regression test for the changes in
https://github.com/JetBrains/kotlin/pull/2613

These checks also caught a similar issue for destructuring
lambda parameters, where the local is introduced before the
value has been written to the local slot. This change also
fixes that.

Finally, this change fixes the asmLike tests to correctly
look up the name of parameters in the locals table.
2019-10-07 15:06:44 +02:00

14 lines
319 B
Kotlin
Vendored

// WITH_RUNTIME
fun box() {
val map: Map<String, String> = mapOf()
for ((a, b) in map) {
a + b
}
}
// METHOD : DestructuringInForKt.box()V
// VARIABLE : NAME=b TYPE=Ljava/lang/String; INDEX=4
// VARIABLE : NAME=a TYPE=Ljava/lang/String; INDEX=3
// VARIABLE : NAME=map TYPE=Ljava/util/Map; INDEX=0