Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt
T
2020-12-16 19:52:30 +03:00

64 lines
1005 B
Kotlin
Vendored

class Foo {
val x = 1
fun abc() = x
fun cba() = abc()
}
class Bar {
val x = ""
// NB: unused
fun Foo.abc() = x
fun bar(): Bar = this
// NB: unused
operator fun String.plus(bar: Bar): String {
return ""
}
// NB! abc() here is resolved to member Foo.abc(), and not to extension member of Bar
fun Foo.check() = <!NONE_APPLICABLE{LT}!>abc() <!NONE_APPLICABLE{PSI}!>+<!> bar()<!>
// NB! + here is resolved to member String.plus (not to extension member above)
fun Foo.check2() = "" + bar()
}
fun Foo.ext() = x
fun bar() {
}
fun buz() {
bar()
}
fun f() {
val a = 10
val b = a
val d = ""
val c = <!UNRESOLVED_REFERENCE!>c<!>
<!UNRESOLVED_REFERENCE{LT}!><!UNRESOLVED_REFERENCE{PSI}!>abc<!>()<!>
fun bcd() {}
fun abc() {
val a = d
val b = a
bcd()
fun dcb() {}
dcb()
}
<!UNRESOLVED_REFERENCE{LT}!><!UNRESOLVED_REFERENCE{PSI}!>dcb<!>()<!>
abc()
}