mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
- generate fake jump instructions so that we can always analyze stack depths - fix stack before break and continue by dropping excessive elements (e.g., *a*.foo(*b*, c?:continue)) - Analyzer rewritten in Kotlin, with more flexible control of CFG traversal #Fixed KT-3340 #Fixed KT-4258 #Fixed KT-7941
17 lines
357 B
Kotlin
Vendored
17 lines
357 B
Kotlin
Vendored
inline fun bar(block: () -> String) : String {
|
|
return block()
|
|
}
|
|
|
|
inline fun bar2() : String {
|
|
while (true) break
|
|
return bar { return "def" }
|
|
}
|
|
|
|
fun foobar(x: String, y: String, z: String) = x + y + z
|
|
|
|
fun box(): String {
|
|
val test = foobar("abc", bar2(), "ghi")
|
|
return if (test == "abcdefghi")
|
|
"OK"
|
|
else "Failed, test=$test"
|
|
} |