mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
30 lines
400 B
Plaintext
30 lines
400 B
Plaintext
package toplevelObjectDeclarations
|
|
|
|
class Foo(y : Int) {
|
|
~foo()~open fun foo() : Int = 1
|
|
}
|
|
|
|
object ~A~A : Foo(0) {
|
|
~x~val x : Int = 2
|
|
|
|
fun test() {
|
|
return `x`x + `foo()`foo()
|
|
}
|
|
}
|
|
|
|
object B : A {}
|
|
|
|
~ns.x~val x = `A`A.`foo()`foo()
|
|
|
|
fun f() {
|
|
~y~val y = object : Foo(`ns.x`x) {
|
|
{
|
|
`ns.x`x + 12
|
|
}
|
|
|
|
~y.foo()~override fun foo() : Int = 1
|
|
}
|
|
|
|
val z = `y`y.`y.foo()`foo()
|
|
}
|