Report error on non-reified type parameter with recursive bound in typeOf

Instead of throwing an exception.

 #KT-40173
This commit is contained in:
Alexander Udalov
2021-07-06 16:21:13 +02:00
parent 438ce57183
commit 02774fae0c
10 changed files with 44 additions and 3 deletions
@@ -672,6 +672,12 @@ public class DiagnosticsTestWithJvmIrBackendGenerated extends AbstractDiagnostic
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJvmBackend/typeOf"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("nonReifiedTypeParameterWithRecursiveBound.kt")
public void testNonReifiedTypeParameterWithRecursiveBound() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJvmBackend/typeOf/nonReifiedTypeParameterWithRecursiveBound.kt");
}
@Test
@TestMetadata("suspendType.kt")
public void testSuspendType() throws Exception {
@@ -660,6 +660,12 @@ public class DiagnosticsTestWithOldJvmBackendGenerated extends AbstractDiagnosti
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJvmBackend/typeOf"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_OLD, true);
}
@Test
@TestMetadata("nonReifiedTypeParameterWithRecursiveBound.kt")
public void testNonReifiedTypeParameterWithRecursiveBound() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJvmBackend/typeOf/nonReifiedTypeParameterWithRecursiveBound.kt");
}
@Test
@TestMetadata("suspendType.kt")
public void testSuspendType() throws Exception {