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

^KT-59791 In Progress
This commit is contained in:
Denis.Zharkov
2023-12-13 15:08:19 +01:00
committed by Space Team
parent 8459465177
commit b9019d3de1
74 changed files with 232 additions and 205 deletions
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
class LocalClass {
fun localClassMember() {
val innerBuildee = build innerBuild@ {
@@ -17,7 +17,7 @@ fun test() {
}
// 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<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
object {
fun anonymousObjectMember() {
val innerBuildee = build innerBuild@ {
@@ -17,7 +17,7 @@ fun test() {
}
// 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<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
fun localFunction() {
val innerBuildee = build innerBuild@ {
this@outerBuild.setTypeVariable(TargetType())
@@ -15,7 +15,7 @@ fun test() {
}
// 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<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,7 +2,7 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val outerBuildee = build outerBuild@ {
val innerBuildee = build innerBuild@ {
this@outerBuild.setTypeVariable(TargetType())
this@innerBuild.setTypeVariable(TargetType())
@@ -13,7 +13,7 @@ fun test() {
}
// 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<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -2,8 +2,8 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val outerBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> outerBuild@ {
val middleBuildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> middleBuild@ {
val outerBuildee = build outerBuild@ {
val middleBuildee = build middleBuild@ {
val innerBuildee = build innerBuild@ {
this@outerBuild.setTypeVariable(TargetType())
this@middleBuild.setTypeVariable(TargetType())
@@ -15,11 +15,11 @@ fun test() {
}
// 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<TargetType><!>>(middleBuildee)
checkExactType<Buildee<TargetType>>(middleBuildee)
}
// 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<TargetType><!>>(outerBuildee)
checkExactType<Buildee<TargetType>>(outerBuildee)
}
@@ -4,7 +4,7 @@
fun test() {
val buildee = build {
setTypeVariable(TargetType())
consume(<!ARGUMENT_TYPE_MISMATCH!>getTypeVariable()<!>)
consume(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
@@ -2,14 +2,14 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
this as DerivedBuildee<*>
getTypeVariable()
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<!>)
}
@@ -3,8 +3,8 @@
fun test() {
val buildee = initializeAndBuild(
{ build <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ setTypeVariable(TargetType()) }<!> },
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ placeholderExtensionInvokeOnBuildee() }<!>,
{ build { setTypeVariable(TargetType()) } },
{ placeholderExtensionInvokeOnBuildee() },
)
// 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,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
typeVariableMutableProperty = ""
}
// 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<String><!>>(buildee)
checkExactType<Buildee<String>>(buildee)
}
@@ -2,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
typeVariableMutableProperty = 42
}
// 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<Int><!>>(buildee)
checkExactType<Buildee<Int>>(buildee)
}
@@ -2,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildee = build {
typeVariableMutableProperty = {}
}
// 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<() -> Unit><!>>(buildee)
checkExactType<Buildee<() -> Unit>>(buildee)
}
@@ -8,7 +8,7 @@ fun test() {
}
// 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>>(<!ARGUMENT_TYPE_MISMATCH!>buildee<!>)
checkExactType<Buildee<TargetType>>(buildee)
}
@@ -11,13 +11,13 @@ fun <ETV> Buildee<ETV>.yieldWithoutAnnotation(value: ETV) {}
fun <ETV> Buildee<ETV>.yieldWithAnnotation(t: ETV) {}
fun test() {
val buildeeA = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
val buildeeA = build {
yieldWithoutAnnotation(materializeBuildee<TargetType>())
yieldWithoutAnnotation(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materializeBuildee<!>())
yieldWithoutAnnotation(materializeBuildee())
}
// 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<TargetType>><!>>(buildeeA)
checkExactType<Buildee<Buildee<TargetType>>>(buildeeA)
val buildeeB = build {
yieldWithAnnotation(materializeBuildee<TargetType>())
@@ -2,10 +2,10 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
setTypeVariable(TargetType())
extensionSetOutProjectedTypeVariable(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)
@@ -5,7 +5,7 @@
fun test() {
val buildee = build {
setTypeVariable(Any())
<!OVERLOAD_RESOLUTION_AMBIGUITY!>consumeBuildeeReceiver<!>()
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
@@ -4,7 +4,7 @@
fun test() {
val buildee = build {
setTypeVariable(TargetType())
<!OVERLOAD_RESOLUTION_AMBIGUITY!>consume<!>(getTypeVariable())
consume(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
@@ -0,0 +1,29 @@
// ISSUE: KT-60291
// CHECK_TYPE_WITH_EXACT
// WITH_STDLIB
fun test() {
val buildee = selectBuildee(
build { setTypeVariable(TargetType()) },
build {}
)
// 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)
}
fun <T> selectBuildee(vararg values: Buildee<T>): Buildee<T> = values.first()
class TargetType
class Buildee<TV> {
fun setTypeVariable(value: TV) { storage = value }
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,5 +1,4 @@
// ISSUE: KT-60291
// FIR_IDENTICAL
// CHECK_TYPE_WITH_EXACT
// WITH_STDLIB
@@ -0,0 +1,26 @@
// ISSUE: KT-60291
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = if (true)
build { setTypeVariable(TargetType()) }
else
build {}
// 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 }
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,5 +1,4 @@
// ISSUE: KT-60291
// FIR_IDENTICAL
// CHECK_TYPE_WITH_EXACT
fun test() {
@@ -0,0 +1,27 @@
// ISSUE: KT-60291
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = when ("") {
"true" -> build { setTypeVariable(TargetType()) }
"false" -> build {}
else -> Buildee()
}
// 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 }
private var storage: TV = null!!
}
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
return Buildee<PTV>().apply(instructions)
}
@@ -1,5 +1,4 @@
// ISSUE: KT-60291
// FIR_IDENTICAL
// CHECK_TYPE_WITH_EXACT
fun test() {
@@ -1,30 +0,0 @@
// ISSUE: KT-61310
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>build<!> {
if (true) {
setTypeVariable(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>GenericBox<!>())
} else {
setTypeVariable(GenericBox<TargetType>())
}
}
// 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<GenericBox<TargetType>><!>>(buildee)
}
class TargetType
class GenericBox<T>
class Buildee<TV> {
fun setTypeVariable(value: TV) { storage = value }
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-61310
// CHECK_TYPE_WITH_EXACT
@@ -10,11 +10,11 @@ fun test() {
}
val buildee = boundedBuild {
setBoundedTypeVariable(TargetType())
setBoundedTypeVariable(<!ARGUMENT_TYPE_MISMATCH!>DifferentType()<!>)
setBoundedTypeVariable(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<BoundedBuildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH("BoundedBuildee<TargetType>; BoundedBuildee<kotlin.Any>")!>buildee<!>)
checkExactType<BoundedBuildee<TargetType>>(buildee)
}
@@ -3,12 +3,12 @@
// WITH_STDLIB
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
select(
replaceTypeVariable(TargetType()),
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,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
if (true)
replaceTypeVariable(TargetType())
else
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,12 +2,12 @@
// CHECK_TYPE_WITH_EXACT
fun test() {
val buildee = <!NEW_INFERENCE_ERROR!>build {
val buildee = build {
when {
true -> replaceTypeVariable(TargetType())
else -> 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)