K2: Adjust test data after PCLA implementation [multiLambdaRestriction]

^KT-59791 In Progress
This commit is contained in:
Denis.Zharkov
2023-12-19 18:43:54 +01:00
committed by Space Team
parent b9019d3de1
commit 8365eb54dd
9 changed files with 39 additions and 39 deletions
@@ -3,8 +3,8 @@
fun test() { fun test() {
val buildee = buildFromValue( val buildee = buildFromValue(
innerBuild <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ setInnerTypeVariable(TargetType()) }<!>, innerBuild { setInnerTypeVariable(TargetType()) },
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ <!BUILDER_INFERENCE_STUB_RECEIVER!>it.placeholderExtensionInvokeOnInnerBuildee()<!> }<!> { it.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>placeholderExtensionInvokeOnInnerBuildee<!>() }
) )
// exact type equality check — turns unexpected compile-time behavior into red code // 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 // considered to be non-user-reproducible code for the purposes of these tests
@@ -3,17 +3,17 @@
fun test() { fun test() {
val buildee = stepByStepBuild( val buildee = stepByStepBuild(
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
it.<!UNRESOLVED_REFERENCE!>concreteTypeMemberProperty<!> it.<!UNRESOLVED_REFERENCE!>concreteTypeMemberProperty<!>
TargetType() TargetType()
}<!>, },
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
consumeTargetTypeBase(it) consumeTargetTypeBase(it)
}<!> }
) )
// exact type equality check — turns unexpected compile-time behavior into red code // 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 // considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH("Buildee<TargetType>; Buildee<TargetTypeBase>")!>buildee<!>) checkExactType<Buildee<TargetType>>(buildee)
} }
@@ -2,17 +2,17 @@
// CHECK_TYPE_WITH_EXACT // CHECK_TYPE_WITH_EXACT
fun test() { fun test() {
val buildee = parallelBuild( val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>parallelBuild<!>(
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
consumeTargetTypeBase(it) consumeTargetTypeBase(it)
}<!>, },
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
consumeTargetType(it) consumeTargetType(it)
}<!> }
) )
// exact type equality check — turns unexpected compile-time behavior into red code // 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 // considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH("Buildee<TargetType>; Buildee<TargetTypeBase>")!>buildee<!>) <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(buildee)
} }
@@ -3,16 +3,16 @@
fun test() { fun test() {
val buildee = parallelBuild( val buildee = parallelBuild(
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
setTypeVariable(TargetType()) setTypeVariable(TargetType())
}<!>, },
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
consumeDifferentType(getTypeVariable()) consumeDifferentType(<!ARGUMENT_TYPE_MISMATCH!>getTypeVariable()<!>)
}<!> }
) )
// exact type equality check — turns unexpected compile-time behavior into red code // 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 // considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH("Buildee<TargetType>; Buildee<kotlin.Any>")!>buildee<!>) checkExactType<Buildee<TargetType>>(buildee)
} }
@@ -3,16 +3,16 @@
fun test() { fun test() {
val buildee = parallelInOutBuild( val buildee = parallelInOutBuild(
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
setInProjectedTypeVariable(TargetType()) setInProjectedTypeVariable(TargetType())
}<!>, },
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ {
consumeDifferentType(getOutProjectedTypeVariable()) consumeDifferentType(<!ARGUMENT_TYPE_MISMATCH!>getOutProjectedTypeVariable()<!>)
}<!> }
) )
// exact type equality check — turns unexpected compile-time behavior into red code // 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 // considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<TargetType>>(<!ARGUMENT_TYPE_MISMATCH("Buildee<TargetType>; Buildee<kotlin.Any>")!>buildee<!>) checkExactType<Buildee<TargetType>>(buildee)
} }
@@ -3,7 +3,7 @@
fun test() { fun test() {
foo( foo(
flow { emit(0) } flow { emit(0) }
) <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ <!BUILDER_INFERENCE_STUB_RECEIVER!>it.collect <!TOO_MANY_ARGUMENTS!>{}<!><!> }<!> ) { it.collect <!TOO_MANY_ARGUMENTS!>{}<!> }
// 0. Initial // 0. Initial
// W <: Any / declared upper bound // W <: Any / declared upper bound
@@ -12,7 +12,7 @@ data class Output(val source: InputWrapper<List<String>>)
fun main2(input: InputWrapper<Unit>): Output { fun main2(input: InputWrapper<Unit>): Output {
val output = input.doMapping( val output = input.doMapping(
foo = { buildList { add("this is List<String>") } }, foo = { buildList { add("this is List<String>") } },
bar = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ it.isNotEmpty() }<!>, bar = { it.isNotEmpty() },
) )
return Output(source = output) return Output(source = output)
@@ -9,9 +9,9 @@ fun <R> a(first: R, second: (List<R>) -> Unit) {}
fun test1() { fun test1() {
a( a(
buildList { add("") }, buildList { add("") },
second = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ second = {
it.myGenericExt() it.myGenericExt()
}<!> }
) )
} }
@@ -21,11 +21,11 @@ fun <R> b(first: () -> List<R>, second: (List<R>) -> Unit) {}
fun test2() { fun test2() {
b( b(
first = { first = {
buildList { add("") } buildList { add(<!ARGUMENT_TYPE_MISMATCH!>""<!>) }
}, },
second = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ second = {
it.myExt() // Note: must be extension to add constraints it.myExt() // Note: must be extension to add constraints
}<!> }
) )
} }
@@ -45,13 +45,13 @@ fun test3() {
) )
select ( select (
myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add("") }<!>, myBuildList { add("") },
myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add(1) }<!>, myBuildList { add(1) },
) )
select ( select (
run { myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add("") }<!> }, run { myBuildList { add("") } },
myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add(1) }<!>, myBuildList { add(1) },
) )
} }
@@ -64,7 +64,7 @@ fun <D> buildPartList(left: MutableList<D>.() -> Unit, right: MutableList<D>.()
fun test4() { fun test4() {
buildPartList( buildPartList(
left = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add(1) }<!>, left = { add(1) },
right = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add("") }<!> right = { add("") }
) )
} }
@@ -22,7 +22,7 @@ fun <R> b(first: () -> List<R>, second: (List<R>) -> Unit) {}
fun test2() { fun test2() {
b( b(
first = { first = {
buildList { add("") } buildList { add(<!ARGUMENT_TYPE_MISMATCH!>""<!>) }
}, },
second = { second = {
it.myExt() // Note: must be extension to add constraints it.myExt() // Note: must be extension to add constraints