blob: 53ed3f4f2c3a24dce2878d541ff310b97cd5525e [file]
// RUN_PIPELINE_TILL: CODEGEN
// ISSUE: KT-51228
interface A {
fun foo()
}
fun Any.test_1() {
when(this) {
is A -> {
foo() // ok
::foo // UNRESOLVED_REFERENCE, should be ok
}
else -> throw Exception()
}
}
fun Any.test_2() {
when(this) {
is A -> {
foo(); // ok
{ foo() }
}
else -> {}
}
}
fun Any.test_3() {
if (this is A) {
val f = ::foo // ok
}
}
/* GENERATED_FIR_TAGS: callableReference, funWithExtensionReceiver, functionDeclaration, ifExpression,
interfaceDeclaration, isExpression, lambdaLiteral, localProperty, propertyDeclaration, smartcast, thisExpression,
whenExpression, whenWithSubject */