Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt
T
Stanislav Erokhin 298a075381 Minor. removed functions which declared in Standard.kt from diagnostic testdata.
Removed declaration for functions: TODO, run, with, apply, let.
2016-01-25 19:13:31 +03:00

62 lines
640 B
Kotlin
Vendored

class Foo {}
operator fun Foo.invoke() {}
//no variable
fun test(foo: Foo) {
foo()
}
//variable as member
interface A {
val foo: Foo
}
fun test(a: A) {
a.foo()
with (a) {
foo()
}
}
//variable as extension
interface B {
}
val B.foo: Foo
get() = Foo()
fun test(b: B) {
b.foo()
with (b) {
foo()
}
}
//variable as member extension
interface C
interface D {
val C.foo: Foo
fun test(c: C) {
c.foo()
with (c) {
foo()
}
}
}
fun test(d: D, c: C) {
with (d) {
c.foo()
with (c) {
foo()
}
}
}