JS: add some tests to ensure that AST metadata is correctly serialized and deserialized and visible to JS optimizer
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/// FILE: a.kt
|
||||
|
||||
fun a() = "["
|
||||
|
||||
fun b() = "]"
|
||||
|
||||
inline fun sideEffect(f: () -> String, g: () -> Unit): String {
|
||||
g()
|
||||
return f()
|
||||
}
|
||||
|
||||
inline fun foo(f: () -> String, g: () -> Unit): String {
|
||||
return a() + sideEffect(f, g) + b()
|
||||
}
|
||||
|
||||
|
||||
// FILE: b.kt
|
||||
// RECOMPILE
|
||||
|
||||
fun box(): String {
|
||||
val result = foo({ "*" }, { })
|
||||
if (result != "[*]") return "fail: $result"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user