Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt
T
Dmitriy Novozhilov f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00

64 lines
902 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() = abc() <!NONE_APPLICABLE!>+<!> 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!>abc<!>()
fun bcd() {}
fun abc() {
val a = d
val b = a
bcd()
fun dcb() {}
dcb()
}
<!UNRESOLVED_REFERENCE!>dcb<!>()
abc()
}