Allow super calls in object declarations
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
open class A (val s: Int) {
|
||||
open fun foo(): Int {
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
object Outer: A(1) {
|
||||
object O: A(2) {
|
||||
override fun foo(): Int {
|
||||
val s = super<A>.foo()
|
||||
return s + 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
return if (Outer.O.foo() == 5) "OK" else "fail"
|
||||
}
|
||||
Reference in New Issue
Block a user