Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/smartcastToStarProjection.kt
T
Dmitriy Novozhilov 6a343e7bff [FIR] Resolve forks in constraint system after analysis of postponed lambda
When constraint system has forks in it usually we solve all of them before
  starting full completion of corresponding call. But if some call with
  forks was a last statement of postponed lambda, we will never call
  completion for it with FULL mode. Instead of it we complete it in PARTIAL
  mode and then just merge its constraint storage into storage of outer
  call. So all forks from this inner call just remain unresolved inside
  outer system without this fix

^KT-55966 Fixed
2023-02-01 15:02:02 +00:00

19 lines
425 B
Kotlin
Vendored

// SKIP_TXT
// ISSUE: KT-55966
// INFERENCE_HELPERS
class Inv<T>
abstract class A<T>
fun <T> get(e: A<T>): T = null!!
fun <K> produce(producer: () -> K): K = null!!
fun <O> test(t: A<O>) {
@Suppress("UNCHECKED_CAST")
t as A<Inv<*>>
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*>")!>id(get(<!DEBUG_INFO_SMARTCAST!>t<!>))<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*>")!>produce { get(<!DEBUG_INFO_SMARTCAST!>t<!>) }<!>
}