Files
kotlin-fork/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.fir.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

38 lines
651 B
Kotlin
Vendored

fun <T> getT(): T = null!!
class Test<in I> {
private fun foo() : I = getT()
fun apply(i: I) {}
init {
foo()
this.foo()
}
fun test() {
apply(foo())
apply(this.foo())
with(Test<I>()) {
apply(foo()) // resolved to this@Test.foo
apply(this.foo())
apply(this@with.foo())
apply(this@Test.foo())
}
}
fun <I> test(t: Test<I>) {
t.apply(t.foo())
}
companion object {
fun <I> test(t: Test<I>) {
t.apply(t.foo())
}
}
}
fun <I> test(t: Test<I>) {
t.apply(t.<!HIDDEN!>foo<!>())
}