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
+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