Fixes for cases where unexpected declaration descriptor hierarchy caused invalid scoping structure in js backend.
Minor refactorings.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
package foo
|
||||
|
||||
class A() {
|
||||
fun foo() = 1
|
||||
fun a(f : A.()->Int) : Int {
|
||||
return f()
|
||||
}
|
||||
}
|
||||
|
||||
var d = 0
|
||||
|
||||
val p : A.()->Int = {
|
||||
d = foo()
|
||||
d++
|
||||
}
|
||||
|
||||
val c = A().a(p)
|
||||
|
||||
fun box() = (c == 1)
|
||||
@@ -0,0 +1,19 @@
|
||||
package foo
|
||||
|
||||
class A() {
|
||||
|
||||
fun lold() = true
|
||||
val p : ()->Boolean
|
||||
{
|
||||
$p = {{lold()}()}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun box() : Boolean {
|
||||
return A().p()
|
||||
}
|
||||
|
||||
fun main(arg : Array<String>) {
|
||||
println(box())
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
fun lold() = true
|
||||
|
||||
val p = {{lold()}()}
|
||||
|
||||
fun box() = p() && foo.p()
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package foo
|
||||
|
||||
var p = 0
|
||||
val c = p++ // creates temporary value
|
||||
|
||||
fun box() = (p == 1) && (c == 0)
|
||||
Reference in New Issue
Block a user