K2: Adjust test data after PCLA implementation [red-to-red]

^KT-59791 In Progress
This commit is contained in:
Denis.Zharkov
2023-12-13 15:09:23 +01:00
committed by Space Team
parent 276f5b26d8
commit 6052e24626
63 changed files with 272 additions and 281 deletions
@@ -4,7 +4,7 @@
fun test() {
val buildee = build {
setTypeVariable(TargetType())
letForTypeVariable { it.<!NONE_APPLICABLE!>extensionProduceConcreteType<!>() }
letForTypeVariable { <!BUILDER_INFERENCE_STUB_RECEIVER!>it<!>.extensionProduceConcreteType() }
}
// 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
@@ -2,14 +2,14 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
this as DerivedBuildee<*, *>
getTypeVariableA()
getTypeVariableB()
}
// 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
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<*, *><!>>(buildee)
checkExactType<Buildee<*, *>>(<!ARGUMENT_TYPE_MISMATCH!>buildee<!>)
}
@@ -2,13 +2,13 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
this as DerivedBuildee<*>
getTypeVariable()
}
// 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
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<*><!>>(buildee)
checkExactType<Buildee<*>>(<!ARGUMENT_TYPE_MISMATCH!>buildee<!>)
}
@@ -4,11 +4,11 @@
fun test() {
val buildee = build {
setTypeVariable(TargetType())
consumeDifferentTypeCallable(<!ARGUMENT_TYPE_MISMATCH!>this::getTypeVariable<!>)
consumeDifferentTypeCallable(this::<!INAPPLICABLE_CANDIDATE!>getTypeVariable<!>)
}
// 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)
checkExactType<Buildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH!>buildee<!>)
}
@@ -2,10 +2,10 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
setTypeVariable(TargetType())
consumeDifferentType(extensionReplaceOutProjectedTypeVariable(DifferentType()))
}<!>
consumeDifferentType(<!ARGUMENT_TYPE_MISMATCH!>extensionReplaceOutProjectedTypeVariable(DifferentType())<!>)
}
// 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)
@@ -2,10 +2,10 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
setTypeVariable(TargetType())
consumeDifferentTypeSubtype(getTypeVariable())
}<!>
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>consumeDifferentTypeSubtype<!>(<!ARGUMENT_TYPE_MISMATCH!>getTypeVariable()<!>)
}
// 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)
@@ -4,7 +4,7 @@
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
setTypeVariable(DifferentType())
consumeBuildeeReceiver()
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>consumeBuildeeReceiver<!>()
}<!>
// 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
@@ -1,27 +0,0 @@
// ISSUE: KT-59798
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = build {
setTypeVariable(TargetType())
<!BUILDER_INFERENCE_STUB_RECEIVER!>getTypeVariable().let {}<!>
}
// 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 TargetType
class Buildee<TV> {
fun setTypeVariable(value: TV) { storage = value }
fun getTypeVariable(): TV = storage
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-59798
// CHECK_TYPE_WITH_EXACT
@@ -4,7 +4,7 @@
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
setTypeVariable(TargetType())
<!BUILDER_INFERENCE_STUB_RECEIVER!>getTypeVariable().consumeDifferentTypeReceiver()<!>
getTypeVariable().<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>consumeDifferentTypeReceiver<!>()
}<!>
// 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
@@ -8,7 +8,7 @@ fun test() {
val targetTypeBuildee = build {
var variable = getTypeVariable()
variable = TargetType()
variable.targetTypeMemberFunction()
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
}
// 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
@@ -26,15 +26,15 @@ fun test() {
val anyBuildee = build {
var variable = getTypeVariable()
variable = TargetType()
variable.targetTypeMemberFunction()
variable = DifferentType()
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
variable = <!ASSIGNMENT_TYPE_MISMATCH!>DifferentType()<!>
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
variable = TargetType()
variable.targetTypeMemberFunction()
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
}
// 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<Any>>(anyBuildee)
checkExactType<Buildee<Any>>(<!ARGUMENT_TYPE_MISMATCH!>anyBuildee<!>)
}