mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
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.
14 lines
319 B
Kotlin
Vendored
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 |