2796d21ec6
This fixes an issue if type of some implicit receiver was changed because of changed smartcast in outer scope ^KT-51228 Fixed
32 lines
453 B
Kotlin
Vendored
32 lines
453 B
Kotlin
Vendored
// 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
|
|
}
|
|
}
|