Containing declaration elimination (#225)
* rewrote AbstractClosureAnnotator not using containingDeclaration * bug fix * bug fix * review fixes + tests * review fixes * refactoring * fix
This commit is contained in:
@@ -128,7 +128,6 @@ task objectInitialization(type: RunKonanTest) {
|
||||
}
|
||||
|
||||
task objectInitialization1(type: RunKonanTest) {
|
||||
disabled = true
|
||||
goldValue = "init\nfield\nconstructor1\ninit\nfield\nconstructor1\nconstructor2\n"
|
||||
source = "codegen/object/initialization1.kt"
|
||||
}
|
||||
@@ -379,6 +378,11 @@ task innerClass_superOuter(type: RunKonanTest) {
|
||||
source = "codegen/innerClass/superOuter.kt"
|
||||
}
|
||||
|
||||
task innerClass_noPrimaryConstructor(type: RunKonanTest) {
|
||||
goldValue = "OK\nOK\n"
|
||||
source = "codegen/innerClass/noPrimaryConstructor.kt"
|
||||
}
|
||||
|
||||
task localClass_localHierarchy(type: RunKonanTest) {
|
||||
goldValue = "OK\n"
|
||||
source = "codegen/localClass/localHierarchy.kt"
|
||||
@@ -409,6 +413,11 @@ task localClass_virtualCallFromConstructor(type: RunKonanTest) {
|
||||
source = "codegen/localClass/virtualCallFromConstructor.kt"
|
||||
}
|
||||
|
||||
task localClass_noPrimaryConstructor(type: RunKonanTest) {
|
||||
goldValue = "OKOK\n"
|
||||
source = "codegen/localClass/noPrimaryConstructor.kt"
|
||||
}
|
||||
|
||||
task initializers_correctOrder1(type: RunKonanTest) {
|
||||
goldValue = "42\n"
|
||||
source = "codegen/initializers/correctOrder1.kt"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
class Outer(val s: String) {
|
||||
inner class Inner {
|
||||
constructor(x: Int) {
|
||||
this.x = x
|
||||
}
|
||||
|
||||
constructor(z: String) {
|
||||
x = z.length
|
||||
}
|
||||
|
||||
val x: Int
|
||||
|
||||
fun foo() = s
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
println(Outer("OK").Inner(42).foo())
|
||||
println(Outer("OK").Inner("zzz").foo())
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
fun box(s: String): String {
|
||||
class Local {
|
||||
constructor(x: Int) {
|
||||
this.x = x
|
||||
}
|
||||
|
||||
constructor(z: String) {
|
||||
x = z.length
|
||||
}
|
||||
|
||||
val x: Int
|
||||
|
||||
fun result() = s
|
||||
}
|
||||
|
||||
return Local(42).result() + Local("zzz").result()
|
||||
}
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
println(box("OK"))
|
||||
}
|
||||
Reference in New Issue
Block a user