Files
kotlin-fork/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.fir.kt
T
Dmitriy Novozhilov c64575f4a2 [FIR] Move check for _private-to-this_ visibility into checker
^KT-55446
^KT-65790 Fixed
2024-02-15 13:08:35 +00:00

38 lines
819 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(<!INVISIBLE_REFERENCE!>foo<!>()) // K1: this@Test.foo, K2: this@with.foo, see KT-55446
apply(this.<!INVISIBLE_REFERENCE!>foo<!>())
apply(this@with.<!INVISIBLE_REFERENCE!>foo<!>())
apply(this@Test.foo())
}
}
fun <I> test(t: Test<I>) {
t.apply(t.<!INVISIBLE_REFERENCE!>foo<!>())
}
companion object {
fun <I> test(t: Test<I>) {
t.apply(t.<!INVISIBLE_REFERENCE!>foo<!>())
}
}
}
fun <I> test(t: Test<I>) {
t.apply(t.<!INVISIBLE_REFERENCE!>foo<!>())
}