Add constraints between two different stub variables instead of creating constraint error due to T1 isn't subtype of T2
^KT-44241 Fixed
This commit is contained in:
+12
@@ -17653,6 +17653,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
@@ -17671,6 +17677,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt42139.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt47052.kt")
|
||||
public void testKt47052() throws Exception {
|
||||
|
||||
+3
-1
@@ -446,7 +446,9 @@ object NewCommonSuperTypeCalculator {
|
||||
}
|
||||
|
||||
val equalToEachOtherType = arguments.firstOrNull { potentialSuperType ->
|
||||
arguments.all { AbstractTypeChecker.equalTypes(this, it.getType(), potentialSuperType.getType()) }
|
||||
arguments.all {
|
||||
AbstractTypeChecker.equalTypes(this, it.getType(), potentialSuperType.getType(), stubTypesEqualToAnything = false)
|
||||
}
|
||||
}
|
||||
|
||||
return if (equalToEachOtherType == null) {
|
||||
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
class Foo<K11, K22>(val key: K11) {
|
||||
fun emit1(key: K11) {}
|
||||
fun get(): K11 = null as K11
|
||||
fun emit2(key: K22) {}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <K1, K2> build(@kotlin.BuilderInference builder: Foo<K1, K2>.() -> Unit) {}
|
||||
|
||||
fun run(x: Int) {
|
||||
build {
|
||||
emit1(x)
|
||||
emit2(get()) // We shouldn't report type mismatch, instead we should add constraint StubTypeVariable(K2) >: StubTypeVariable(K1), then infer K2 into Int among K1
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
run(1)
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// DONT_TARGET_EXACT_BACKEND: WASM
|
||||
|
||||
// FILE: Test.java
|
||||
@@ -37,15 +36,6 @@ fun box(): String {
|
||||
intersect(getIn(), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), getIn())
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
intersect(this@build.getIn(), getIn())
|
||||
intersect(getIn(), Test.foo(this@build.getIn()))
|
||||
intersect(Test.foo(this@build.getIn()), Test.foo(getIn()))
|
||||
intersect(Test.foo(getIn()), this@build.getIn())
|
||||
""
|
||||
}
|
||||
""
|
||||
}
|
||||
return "OK"
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// !LANGUAGE: +UnrestrictedBuilderInference
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
class A
|
||||
class B<K> {}
|
||||
class Scope<K11, K22>(
|
||||
val key: K11,
|
||||
) {
|
||||
fun emit(key: K22) {}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <K1, K2> B<K1>.scoped(@kotlin.BuilderInference binder: Scope<K1, K2>.() -> Unit) {}
|
||||
|
||||
fun run(x: B<A>) {
|
||||
x.scoped { emit(key) }
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
run(B<A>())
|
||||
return "OK"
|
||||
}
|
||||
+17
-17
@@ -47,24 +47,24 @@ fun test() {
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select1(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getIn()<!>)
|
||||
select1(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getIn())<!>)
|
||||
select1(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getIn())<!>)
|
||||
select1(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getIn()<!>)
|
||||
select2(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getIn()<!>)
|
||||
select2(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getIn())<!>)
|
||||
select2(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getIn())<!>)
|
||||
select2(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getIn()<!>)
|
||||
select3(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getIn()<!>)
|
||||
select3(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getIn())<!>)
|
||||
select3(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getIn())<!>)
|
||||
select3(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getIn()<!>)
|
||||
select4(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getIn()<!>)
|
||||
select4(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getIn())<!>)
|
||||
select4(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getIn())<!>)
|
||||
select4(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getIn()<!>)
|
||||
select1(this@build.get(), getIn())
|
||||
select1(get(), Test.foo(this@build.getIn()))
|
||||
select1(Test.foo(this@build.get()), Test.foo(getIn()))
|
||||
select1(Test.foo(get()), this@build.getIn())
|
||||
select2(this@build.get(), getIn())
|
||||
select2(get(), Test.foo(this@build.getIn()))
|
||||
select2(Test.foo(this@build.get()), Test.foo(getIn()))
|
||||
select2(Test.foo(get()), this@build.getIn())
|
||||
select3(this@build.get(), getIn())
|
||||
select3(get(), Test.foo(this@build.getIn()))
|
||||
select3(Test.foo(this@build.get()), Test.foo(getIn()))
|
||||
select3(Test.foo(get()), this@build.getIn())
|
||||
select4(this@build.get(), getIn())
|
||||
select4(get(), Test.foo(this@build.getIn()))
|
||||
select4(Test.foo(this@build.get()), Test.foo(getIn()))
|
||||
select4(Test.foo(get()), this@build.getIn())
|
||||
|
||||
select4(id(Test.foo(this@build.get())), <!ARGUMENT_TYPE_MISMATCH!>getIn()<!>)
|
||||
select4(id(Test.foo(this@build.get())), getIn())
|
||||
""
|
||||
}
|
||||
""
|
||||
|
||||
+17
-17
@@ -47,24 +47,24 @@ fun test() {
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select1(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>getIn()<!>)
|
||||
select1(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>Test.foo(this@build.getIn())<!>)
|
||||
select1(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!")!>Test.foo(getIn())<!>)
|
||||
select1(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)!")!>this@build.getIn()<!>)
|
||||
select2(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>getIn()<!>)
|
||||
select2(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>Test.foo(this@build.getIn())<!>)
|
||||
select2(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!")!>Test.foo(getIn())<!>)
|
||||
select2(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)!")!>this@build.getIn()<!>)
|
||||
select3(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!!")!>getIn()<!>)
|
||||
select3(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)!!")!>Test.foo(this@build.getIn())<!>)
|
||||
select3(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>Test.foo(getIn())<!>)
|
||||
select3(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>this@build.getIn()<!>)
|
||||
select4(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!!")!>getIn()<!>)
|
||||
select4(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)!!")!>Test.foo(this@build.getIn())<!>)
|
||||
select4(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>Test.foo(getIn())<!>)
|
||||
select4(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>this@build.getIn()<!>)
|
||||
select1(this@build.get(), <!TYPE_MISMATCH("In<String>; In<Int?>")!>getIn()<!>)
|
||||
select1(get(), <!TYPE_MISMATCH("In<Int?>; In<String>!")!>Test.foo(this@build.getIn())<!>)
|
||||
select1(Test.foo(this@build.get()), <!TYPE_MISMATCH("In<String!>; In<Int?>!")!>Test.foo(getIn())<!>)
|
||||
select1(Test.foo(get()), <!TYPE_MISMATCH("In<Int?>; In<String>")!>this@build.getIn()<!>)
|
||||
select2(this@build.get(), <!TYPE_MISMATCH("In<String?>; In<Int?>")!>getIn()<!>)
|
||||
select2(get(), <!TYPE_MISMATCH("In<Int?>; In<String>!")!>Test.foo(this@build.getIn())<!>)
|
||||
select2(Test.foo(this@build.get()), <!TYPE_MISMATCH("In<String?>; In<Int?>!")!>Test.foo(getIn())<!>)
|
||||
select2(Test.foo(get()), <!TYPE_MISMATCH("In<Int?>; In<String>")!>this@build.getIn()<!>)
|
||||
select3(this@build.get(), <!TYPE_MISMATCH("In<String?>; In<Int?>")!>getIn()<!>)
|
||||
select3(get(), <!TYPE_MISMATCH("In<Int?>; In<String>!")!>Test.foo(this@build.getIn())<!>)
|
||||
select3(Test.foo(this@build.get()), <!TYPE_MISMATCH("In<String?>; In<Int?>!")!>Test.foo(getIn())<!>)
|
||||
select3(Test.foo(get()), <!TYPE_MISMATCH("In<Int?>; In<String>")!>this@build.getIn()<!>)
|
||||
select4(this@build.get(), <!TYPE_MISMATCH("In<String>; In<Int?>")!>getIn()<!>)
|
||||
select4(get(), <!TYPE_MISMATCH("In<Int>; In<String>!")!>Test.foo(this@build.getIn())<!>)
|
||||
select4(Test.foo(this@build.get()), <!TYPE_MISMATCH("In<String>; In<Int?>!")!>Test.foo(getIn())<!>)
|
||||
select4(Test.foo(get()), <!TYPE_MISMATCH("In<Int?>; In<String>")!>this@build.getIn()<!>)
|
||||
|
||||
select4(id(Test.foo(this@build.get())), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!!")!>getIn()<!>)
|
||||
select4(id(Test.foo(this@build.get())), <!TYPE_MISMATCH("In<String>; In<Int?>")!>getIn()<!>)
|
||||
""
|
||||
}
|
||||
""
|
||||
|
||||
+17
-17
@@ -47,16 +47,16 @@ fun test() {
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select1(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getInv()<!>)
|
||||
select1(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)
|
||||
select1(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select1(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
select4(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getInv()<!>)
|
||||
select4(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)
|
||||
select4(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select4(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
select1(this@build.get(), getInv())
|
||||
select1(get(), Test.foo(this@build.getInv()))
|
||||
select1(Test.foo(this@build.get()), Test.foo(getInv()))
|
||||
select1(Test.foo(get()), this@build.getInv())
|
||||
select4(this@build.get(), getInv())
|
||||
select4(get(), Test.foo(this@build.getInv()))
|
||||
select4(Test.foo(this@build.get()), Test.foo(getInv()))
|
||||
select4(Test.foo(get()), this@build.getInv())
|
||||
|
||||
select4(id(Test.foo(this@build.get())), <!ARGUMENT_TYPE_MISMATCH!>getInv()<!>)
|
||||
select4(id(Test.foo(this@build.get())), getInv())
|
||||
""
|
||||
}
|
||||
""
|
||||
@@ -78,14 +78,14 @@ fun test() {
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select2(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getInv()<!>)
|
||||
select2(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)
|
||||
select2(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select2(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
select3(this@build.get(), <!ARGUMENT_TYPE_MISMATCH!>getInv()<!>)
|
||||
select3(get(), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)
|
||||
select3(Test.foo(this@build.get()), <!ARGUMENT_TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select3(Test.foo(get()), <!ARGUMENT_TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
select2(this@build.get(), getInv()) // TODO
|
||||
select2(get(), Test.foo(this@build.getInv()))
|
||||
select2(Test.foo(this@build.get()), Test.foo(getInv())) // TODO
|
||||
select2(Test.foo(get()), this@build.getInv())
|
||||
select3(this@build.get(), getInv()) // TODO
|
||||
select3(get(), Test.foo(this@build.getInv()))
|
||||
select3(Test.foo(this@build.get()), Test.foo(getInv())) // TODO
|
||||
select3(Test.foo(get()), this@build.getInv())
|
||||
""
|
||||
}
|
||||
""
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/commonSuperTypeInvariant.kt
Vendored
+16
-16
@@ -47,16 +47,16 @@ fun test() {
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select1(this@build.get(), <!TYPE_MISMATCH!>getInv()<!>)
|
||||
select1(get(), <!TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)
|
||||
select1(Test.foo(this@build.get()), <!TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select1(Test.foo(get()), <!TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int..kotlin.Int?)")!>select4(this@build.get(), <!TYPE_MISMATCH!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(get(), <!TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)<!>
|
||||
select4(Test.foo(this@build.get()), <!TYPE_MISMATCH!>Test.foo(getInv())<!>)
|
||||
select4(Test.foo(get()), <!TYPE_MISMATCH!>this@build.getInv()<!>)
|
||||
select1(<!TYPE_MISMATCH!>this@build.get()<!>, getInv())
|
||||
select1(<!TYPE_MISMATCH!>get()<!>, Test.foo(this@build.getInv()))
|
||||
select1(<!TYPE_MISMATCH!>Test.foo(this@build.get())<!>, Test.foo(getInv()))
|
||||
select1(<!TYPE_MISMATCH!>Test.foo(get())<!>, this@build.getInv())
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int..kotlin.Int?)")!>select4(<!TYPE_MISMATCH!>this@build.get()<!>, getInv())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select4(<!TYPE_MISMATCH!>get()<!>, Test.foo(this@build.getInv()))<!>
|
||||
select4(<!TYPE_MISMATCH!>Test.foo(this@build.get())<!>, Test.foo(getInv()))
|
||||
select4(<!TYPE_MISMATCH!>Test.foo(get())<!>, this@build.getInv())
|
||||
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int..kotlin.Int?)")!>select4(id(Test.foo(this@build.get())), <!TYPE_MISMATCH!>getInv()<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int..kotlin.Int?)")!>select4(<!TYPE_MISMATCH!>id(Test.foo(this@build.get()))<!>, getInv())<!>
|
||||
""
|
||||
}
|
||||
""
|
||||
@@ -78,14 +78,14 @@ fun test() {
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
select2(this@build.get(), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>getInv()<!>)
|
||||
select2(get(), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>Test.foo(this@build.getInv())<!>)
|
||||
select2(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)!")!>Test.foo(getInv())<!>)
|
||||
select2(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)!")!>this@build.getInv()<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select3(this@build.get(), <!TYPE_MISMATCH!>getInv()<!>)<!>
|
||||
select2(this@build.get(), getInv()) // TODO
|
||||
select2(get(), <!TYPE_MISMATCH("Inv<Any?>; Inv<String?>!")!>Test.foo(this@build.getInv())<!>)
|
||||
select2(Test.foo(this@build.get()), Test.foo(getInv())) // TODO
|
||||
select2(Test.foo(get()), <!TYPE_MISMATCH("Inv<Any?>; Inv<String?>")!>this@build.getInv()<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select3(this@build.get(), getInv())<!> // TODO
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select3(get(), <!TYPE_MISMATCH!>Test.foo(this@build.getInv())<!>)<!>
|
||||
select3(Test.foo(this@build.get()), <!TYPE_MISMATCH("TypeVariable(R2); TypeVariable(R1)")!>Test.foo(getInv())<!>)
|
||||
select3(Test.foo(get()), <!TYPE_MISMATCH("TypeVariable(R1); TypeVariable(R2)")!>this@build.getInv()<!>)
|
||||
select3(Test.foo(this@build.get()), Test.foo(getInv())) // TODO
|
||||
select3(Test.foo(get()), <!TYPE_MISMATCH("Inv<Any?>; Inv<String?>")!>this@build.getInv()<!>)
|
||||
""
|
||||
}
|
||||
""
|
||||
|
||||
+4
-4
@@ -38,10 +38,10 @@ fun test() {
|
||||
|
||||
build2 {
|
||||
emit(1)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(this@build.getIn(), getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(getIn(), Test.foo(this@build.getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(Test.foo(this@build.getIn()), Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("{Int & String}")!>intersect(Test.foo(getIn()), this@build.getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>intersect(<!TYPE_MISMATCH!>this@build.getIn()<!>, getIn())<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>intersect(<!TYPE_MISMATCH!>getIn()<!>, Test.foo(this@build.getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>intersect(<!TYPE_MISMATCH!>Test.foo(this@build.getIn())<!>, Test.foo(getIn()))<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>intersect(<!TYPE_MISMATCH!>Test.foo(getIn())<!>, this@build.getIn())<!>
|
||||
""
|
||||
}
|
||||
""
|
||||
|
||||
+12
@@ -17623,6 +17623,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
@@ -17641,6 +17647,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt42139.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt47052.kt")
|
||||
public void testKt47052() throws Exception {
|
||||
|
||||
+12
@@ -17653,6 +17653,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
@@ -17671,6 +17677,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt42139.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt47052.kt")
|
||||
public void testKt47052() throws Exception {
|
||||
|
||||
+10
@@ -14596,6 +14596,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/commonSuperTypeNullable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intersect.kt")
|
||||
public void testIntersect() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/intersect.kt");
|
||||
@@ -14611,6 +14616,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt42139.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt47052.kt")
|
||||
public void testKt47052() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt47052.kt");
|
||||
|
||||
@@ -490,7 +490,7 @@ object AbstractTypeChecker {
|
||||
}
|
||||
|
||||
if (subType.isStubTypeForBuilderInference() && superType.isStubTypeForBuilderInference())
|
||||
return isStubTypeSubtypeOfAnother(subType, superType)
|
||||
return isStubTypeSubtypeOfAnother(subType, superType) || context.isStubTypeEqualsToAnything
|
||||
|
||||
if (subType.isStubType() || superType.isStubType())
|
||||
return context.isStubTypeEqualsToAnything
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+10
@@ -12760,6 +12760,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
@@ -12770,6 +12775,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt42139.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt47052.kt")
|
||||
public void testKt47052() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt47052.kt");
|
||||
|
||||
Generated
+10
@@ -12166,6 +12166,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
@@ -12176,6 +12181,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt42139.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt47052.kt")
|
||||
public void testKt47052() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt47052.kt");
|
||||
|
||||
Generated
+10
@@ -12231,6 +12231,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/capturedTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt41164.kt")
|
||||
public void testKt41164() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt41164.kt");
|
||||
@@ -12241,6 +12246,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt42139.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt47052.kt")
|
||||
public void testKt47052() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt47052.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+10
@@ -6516,6 +6516,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inference/builderInference"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("constraintsBetweenTwoStubVariables.kt")
|
||||
public void testConstraintsBetweenTwoStubVariables() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/constraintsBetweenTwoStubVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44241.kt")
|
||||
public void testKt44241() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/kt44241.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("substituteStubTypeIntolambdaParameterDescriptor.kt")
|
||||
public void testSubstituteStubTypeIntolambdaParameterDescriptor() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inference/builderInference/substituteStubTypeIntolambdaParameterDescriptor.kt");
|
||||
|
||||
Reference in New Issue
Block a user