Local objects (#215)

* bug fix

* bug fix with nested inner classes

* - fixed FixMeInner
- support of inner classes in local classes
- support of object expressions in initializers

* comments

* merged modification

* - review fixes
- tests

* review fixes

* review fixes
This commit is contained in:
Igor Chevdar
2017-02-03 19:41:34 +05:00
committed by GitHub
parent f6cab824ab
commit 2f9bde4482
16 changed files with 299 additions and 103 deletions
@@ -0,0 +1,21 @@
open class Father(val param: String) {
abstract inner class InClass {
fun work(): String {
return param
}
}
inner class Child(p: String) : Father(p) {
inner class Child2 : Father.InClass {
constructor(): super()
}
}
}
fun box(): String {
return Father("fail").Child("OK").Child2().work()
}
fun main(args: Array<String>) {
println(box())
}
@@ -0,0 +1,13 @@
open class Outer(val outer: String) {
open inner class Inner(val inner: String): Outer(inner) {
fun foo() = outer
}
fun value() = Inner("OK").foo()
}
fun box() = Outer("Fail").value()
fun main(args : Array<String>) {
println(box())
}