KT-36047 Support when-with-subject in optimized 'when' generators

This commit is contained in:
Dmitry Petrov
2020-03-11 14:50:06 +03:00
parent fd70b10b17
commit a9ab3ae192
8 changed files with 79 additions and 8 deletions
@@ -0,0 +1,11 @@
fun foo(x: Int): String {
return when (val y = x) {
101 -> "1"
102 -> "2"
103 -> "3"
else -> "else"
}
}
// 0 LOOKUPSWITCH
// 1 TABLESWITCH