K2: Adjust test data after PCLA implementation [multiLambdaRestriction]
^KT-59791 In Progress
This commit is contained in:
committed by
Space Team
parent
b9019d3de1
commit
8365eb54dd
+2
-2
@@ -3,8 +3,8 @@
|
||||
|
||||
fun test() {
|
||||
val buildee = buildFromValue(
|
||||
innerBuild <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ setInnerTypeVariable(TargetType()) }<!>,
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ <!BUILDER_INFERENCE_STUB_RECEIVER!>it.placeholderExtensionInvokeOnInnerBuildee()<!> }<!>
|
||||
innerBuild { setInnerTypeVariable(TargetType()) },
|
||||
{ it.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>placeholderExtensionInvokeOnInnerBuildee<!>() }
|
||||
)
|
||||
// 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
|
||||
|
||||
+5
-5
@@ -3,17 +3,17 @@
|
||||
|
||||
fun test() {
|
||||
val buildee = stepByStepBuild(
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
{
|
||||
it.<!UNRESOLVED_REFERENCE!>concreteTypeMemberProperty<!>
|
||||
TargetType()
|
||||
}<!>,
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
},
|
||||
{
|
||||
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>>(<!ARGUMENT_TYPE_MISMATCH("Buildee<TargetType>; Buildee<TargetTypeBase>")!>buildee<!>)
|
||||
checkExactType<Buildee<TargetType>>(buildee)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
// CHECK_TYPE_WITH_EXACT
|
||||
|
||||
fun test() {
|
||||
val buildee = parallelBuild(
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
val buildee = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>parallelBuild<!>(
|
||||
{
|
||||
consumeTargetTypeBase(it)
|
||||
}<!>,
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
},
|
||||
{
|
||||
consumeTargetType(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>>(<!ARGUMENT_TYPE_MISMATCH("Buildee<TargetType>; Buildee<TargetTypeBase>")!>buildee<!>)
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>checkExactType<!><<!CANNOT_INFER_PARAMETER_TYPE!>Buildee<TargetType><!>>(buildee)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-6
@@ -3,16 +3,16 @@
|
||||
|
||||
fun test() {
|
||||
val buildee = parallelBuild(
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
{
|
||||
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
|
||||
// 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)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-6
@@ -3,16 +3,16 @@
|
||||
|
||||
fun test() {
|
||||
val buildee = parallelInOutBuild(
|
||||
<!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
{
|
||||
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
|
||||
// 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)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
fun test() {
|
||||
foo(
|
||||
flow { emit(0) }
|
||||
) <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ <!BUILDER_INFERENCE_STUB_RECEIVER!>it.collect <!TOO_MANY_ARGUMENTS!>{}<!><!> }<!>
|
||||
) { it.collect <!TOO_MANY_ARGUMENTS!>{}<!> }
|
||||
|
||||
// 0. Initial
|
||||
// W <: Any / declared upper bound
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ data class Output(val source: InputWrapper<List<String>>)
|
||||
fun main2(input: InputWrapper<Unit>): Output {
|
||||
val output = input.doMapping(
|
||||
foo = { buildList { add("this is List<String>") } },
|
||||
bar = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ it.isNotEmpty() }<!>,
|
||||
bar = { it.isNotEmpty() },
|
||||
)
|
||||
|
||||
return Output(source = output)
|
||||
|
||||
Vendored
+11
-11
@@ -9,9 +9,9 @@ fun <R> a(first: R, second: (List<R>) -> Unit) {}
|
||||
fun test1() {
|
||||
a(
|
||||
buildList { add("") },
|
||||
second = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
second = {
|
||||
it.myGenericExt()
|
||||
}<!>
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ fun <R> b(first: () -> List<R>, second: (List<R>) -> Unit) {}
|
||||
fun test2() {
|
||||
b(
|
||||
first = {
|
||||
buildList { add("") }
|
||||
buildList { add(<!ARGUMENT_TYPE_MISMATCH!>""<!>) }
|
||||
},
|
||||
second = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{
|
||||
second = {
|
||||
it.myExt() // Note: must be extension to add constraints
|
||||
}<!>
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -45,13 +45,13 @@ fun test3() {
|
||||
)
|
||||
|
||||
select (
|
||||
myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add("") }<!>,
|
||||
myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add(1) }<!>,
|
||||
myBuildList { add("") },
|
||||
myBuildList { add(1) },
|
||||
)
|
||||
|
||||
select (
|
||||
run { myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add("") }<!> },
|
||||
myBuildList <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add(1) }<!>,
|
||||
run { myBuildList { add("") } },
|
||||
myBuildList { add(1) },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ fun <D> buildPartList(left: MutableList<D>.() -> Unit, right: MutableList<D>.()
|
||||
|
||||
fun test4() {
|
||||
buildPartList(
|
||||
left = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add(1) }<!>,
|
||||
right = <!BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION!>{ add("") }<!>
|
||||
left = { add(1) },
|
||||
right = { add("") }
|
||||
)
|
||||
}
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/builderInference/multiLambdaRestrictionDisabled.fir.kt
Vendored
+1
-1
@@ -22,7 +22,7 @@ fun <R> b(first: () -> List<R>, second: (List<R>) -> Unit) {}
|
||||
fun test2() {
|
||||
b(
|
||||
first = {
|
||||
buildList { add("") }
|
||||
buildList { add(<!ARGUMENT_TYPE_MISMATCH!>""<!>) }
|
||||
},
|
||||
second = {
|
||||
it.myExt() // Note: must be extension to add constraints
|
||||
|
||||
Reference in New Issue
Block a user