[FE] Add regression test for KT-57036

This commit is contained in:
Dmitriy Novozhilov
2023-03-21 12:03:46 +02:00
committed by Space Team
parent e56e058b7b
commit 1ac7d13c96
7 changed files with 84 additions and 0 deletions
@@ -0,0 +1,27 @@
// INFERENCE_HELPERS
// ISSUE: KT-57036
abstract class Base(block: String.() -> Int)
class A(block: String.() -> Int) : Base(block)
class B(block: String.() -> Int) : Base(block)
fun test_1() {
val c = select(::A, ::B)
c { length }
c { <!UNRESOLVED_REFERENCE!>it<!>.length }
}
fun test_2(cond: Boolean) {
val c = if (cond) ::A else ::B
c { length }
c { <!UNRESOLVED_REFERENCE!>it<!>.length }
}
fun test_3(cond: Boolean) {
val c = when(cond) {
true -> ::A
false -> ::B
}
c { length }
c { <!UNRESOLVED_REFERENCE!>it<!>.length }
}