Optimize const vals by inlining them at use sites

#KT-11734 Fixed
 #KT-13570 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2016-12-05 12:02:52 +03:00
parent 8c1e165f18
commit 0134b8819b
28 changed files with 210 additions and 136 deletions

View File

@@ -0,0 +1,12 @@
const val y = "cde"
fun foo(x : String) : String {
when (x) {
"abc", "${y}" -> return "abc_cde"
"e" + "fg", "ghi" -> return "efg_ghi"
}
return "other"
}
// 1 LOOKUPSWITCH

View File

@@ -1,3 +1,5 @@
// LANGUAGE_VERSION: 1.0
const val y = "cde"
fun foo(x : String) : String {