Do not add extra 'this' parameter for TImpl's accessor

Fixes weird cases like super-call from a closure inside a trait with a required
class
This commit is contained in:
Alexander Udalov
2012-11-06 15:42:22 +04:00
parent 2edb89b5c5
commit 89b8bbec57
4 changed files with 47 additions and 2 deletions
@@ -0,0 +1,16 @@
open class Base {
open fun foo() { }
}
trait Derived : Base {
override fun foo() {
super.foo()
}
}
class DerivedImpl : Derived, Base()
fun box(): String {
DerivedImpl().foo()
return "OK"
}
@@ -0,0 +1,20 @@
open class Base {
open fun foo() { }
}
trait Derived : Base {
override fun foo() {
object {
fun bar() {
super<Base>@Derived.foo()
}
}.bar()
}
}
class DerivedImpl : Derived, Base()
fun box(): String {
DerivedImpl().foo()
return "OK"
}