Add a test with false positive "inferred into empty intersection"
Related to KT-50232
This commit is contained in:
+6
@@ -14040,6 +14040,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50232a.kt")
|
||||
public void testKt50232a() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt50232a.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6175.kt")
|
||||
public void testKt6175() throws Exception {
|
||||
|
||||
+6
@@ -14040,6 +14040,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50232a.kt")
|
||||
public void testKt50232a() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt50232a.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6175.kt")
|
||||
public void testKt6175() throws Exception {
|
||||
|
||||
+6
@@ -14040,6 +14040,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50232a.kt")
|
||||
public void testKt50232a() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt50232a.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6175.kt")
|
||||
public void testKt6175() throws Exception {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fun test() {
|
||||
acceptMyRecursive(<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION!>inferType<!><<!UPPER_BOUND_VIOLATED!>MyRecursive?<!>>())
|
||||
}
|
||||
|
||||
fun acceptMyRecursive(value: MyRecursive?) {}
|
||||
|
||||
fun <R : Recursive<R>?> inferType(): R = TODO()
|
||||
|
||||
abstract class Recursive<R>
|
||||
|
||||
class MyRecursive : Recursive<MyRecursive>()
|
||||
@@ -0,0 +1,11 @@
|
||||
fun test() {
|
||||
acceptMyRecursive(<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>inferType<!><<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>MyRecursive?<!>>())
|
||||
}
|
||||
|
||||
fun acceptMyRecursive(value: MyRecursive?) {}
|
||||
|
||||
fun <R : Recursive<R>?> inferType(): R = TODO()
|
||||
|
||||
abstract class Recursive<R>
|
||||
|
||||
class MyRecursive : Recursive<MyRecursive>()
|
||||
@@ -0,0 +1,19 @@
|
||||
package
|
||||
|
||||
public fun acceptMyRecursive(/*0*/ value: MyRecursive?): kotlin.Unit
|
||||
public fun </*0*/ R : Recursive<R>?> inferType(): R
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public final class MyRecursive : Recursive<MyRecursive> {
|
||||
public constructor MyRecursive()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public abstract class Recursive</*0*/ R> {
|
||||
public constructor Recursive</*0*/ R>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Generated
+6
@@ -14046,6 +14046,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt50232a.kt")
|
||||
public void testKt50232a() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/kt50232a.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6175.kt")
|
||||
public void testKt6175() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user