JS backend: testFiles -> testData
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package foo
|
||||
|
||||
fun run<T>(f: () -> T) = f()
|
||||
|
||||
fun funfun(): Boolean {
|
||||
val result = true
|
||||
|
||||
fun foo(): Boolean {
|
||||
fun bar() = result
|
||||
return bar()
|
||||
}
|
||||
|
||||
return foo()
|
||||
}
|
||||
|
||||
fun litlit(): Boolean {
|
||||
val result = true
|
||||
|
||||
return run {
|
||||
run { result }
|
||||
}
|
||||
}
|
||||
|
||||
fun funlit(): Boolean {
|
||||
val result = true
|
||||
|
||||
fun foo(): Boolean {
|
||||
return run { result }
|
||||
}
|
||||
|
||||
return foo()
|
||||
}
|
||||
|
||||
fun litfun(): Boolean {
|
||||
val result = true
|
||||
|
||||
return run {
|
||||
fun bar() = result
|
||||
bar()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (!funfun()) return "funfun failed"
|
||||
if (!litlit()) return "litlit failed"
|
||||
if (!funlit()) return "funlit failed"
|
||||
if (!litfun()) return "litfun failed"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user