Files
kotlin/compiler/testData/resolve/Objects.resolve
Denis Zharkov bca53e6c1c Optimize type checking for common cases
- Type equality for simple constructors (no arguments)
- Subtyping on final classes
2017-10-10 18:27:00 +03:00

30 lines
410 B
Plaintext
Vendored

package toplevelObjectDeclarations
open 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) {
init {
`ns.x`x + 12
}
~y.foo()~override fun foo() : Int = 1
}
val z = `y`y.`y.foo()`foo()
}