Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/priority/memberVsLocalExt.kt
T
Dmitry Petrov 954204da82 KT-1560
Report warning on extensions shadowed by members.
2017-01-16 17:25:13 +03:00

19 lines
326 B
Kotlin
Vendored

// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
class A {
fun foo() = this
}
fun test(a: A) {
fun A.<!EXTENSION_SHADOWED_BY_MEMBER!>foo<!>() = 4
a.foo() checkType { _<A>() }
with(a) {
foo() checkType { _<A>() }
this.foo() checkType { _<A>() }
}
}