Files
kotlin-fork/js/js.translator/testData/box/closure/closureInNestedFunctionsInMethod.kt
T
2018-09-12 09:49:25 +03:00

83 lines
1.6 KiB
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1299
package foo
class A {
val a = 12
var b = 1
fun boo(c: Int) = c
fun litlit() {
val testName = "litlit"
myRun {
myRun {
assertEquals(12, a, testName)
assertEquals(1, b, testName)
b = 23
assertEquals(23, b, testName)
assertEquals(34, boo(34), testName)
}
}
}
fun funfun() {
val testName = "funfun"
fun foo() {
fun bar() {
assertEquals(12, a, testName)
assertEquals(1, b, testName)
b = 23
assertEquals(23, b, testName)
assertEquals(34, boo(34), testName)
}
bar()
}
foo()
}
fun litfun() {
val testName = "litfun"
myRun {
fun bar() {
assertEquals(12, a, testName)
assertEquals(1, b, testName)
b = 23
assertEquals(23, b, testName)
assertEquals(34, boo(34), testName)
}
bar()
}
}
fun funlit() {
val testName = "funlit"
fun foo() {
myRun {
assertEquals(12, a, testName)
assertEquals(1, b, testName)
b = 23
assertEquals(23, b, testName)
assertEquals(34, boo(34), testName)
}
}
foo()
}
}
fun box(): String {
A().litlit()
A().funfun()
A().litfun()
A().funlit()
return "OK"
}