Fixes for cases where unexpected declaration descriptor hierarchy caused invalid scoping structure in js backend.

Minor refactorings.
This commit is contained in:
Pavel V. Talanov
2012-03-15 19:13:40 +04:00
parent e4a658fbeb
commit 090fd1b7f6
17 changed files with 186 additions and 139 deletions
@@ -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()
@@ -0,0 +1,6 @@
package foo
var p = 0
val c = p++ // creates temporary value
fun box() = (p == 1) && (c == 0)