Files
kotlin-fork/compiler/testData/diagnostics/tests/builderInference/issues/kt53422b.fir.kt
T
2024-01-11 10:32:12 +00:00

38 lines
881 B
Kotlin
Vendored

// ISSUE: KT-53422
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = stepByStepBuild(
{
it.<!UNRESOLVED_REFERENCE!>concreteTypeMemberProperty<!>
TargetType()
},
{
consumeTargetTypeBase(it)
}
)
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(buildee)
}
class ConcreteType
open class TargetTypeBase {
val concreteTypeMemberProperty: ConcreteType = ConcreteType()
}
class TargetType: TargetTypeBase()
fun consumeTargetTypeBase(value: TargetTypeBase) {}
class Buildee<TV>
fun <PTV> stepByStepBuild(
instructionsA: Buildee<PTV>.(PTV) -> PTV,
instructionsB: Buildee<PTV>.(PTV) -> Unit,
): Buildee<PTV> {
return null!!
}