Files
kotlin-fork/js/js.translator/testData/box/extensionFunction/extensionPropertyOnClassWithExplicitAndImplicitReceiver.kt
T
2018-09-12 09:49:25 +03:00

26 lines
415 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1286
package foo
class Foo {
fun blah(value: Int): Int {
return value + 1
}
}
val Foo.fooImp: Int
get() {
return blah(5)
}
val Foo.fooExp: Int
get() {
return this.blah(10)
}
fun box(): String {
var a = Foo()
if (a.fooImp != 6) return "fail1: ${a.fooImp}"
if (a.fooExp != 11) return "fail2: ${a.fooExp}"
return "OK";
}