Support generic underlying type of inline class

Use upper bound in JVM representation.
 #KT-32162
This commit is contained in:
Ilmir Usmanov
2021-12-09 03:37:17 +01:00
parent 732b8d4067
commit 9060168542
22 changed files with 326 additions and 12 deletions
@@ -16835,6 +16835,28 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue")
@TestDataPath("$PROJECT_ROOT")
public class GenericUnderlyingValue {
@Test
public void testAllFilesPresentInGenericUnderlyingValue() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue/simple.kt");
}
@Test
@TestMetadata("upperBound.kt")
public void testUpperBound() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue/upperBound.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
@TestDataPath("$PROJECT_ROOT")
@@ -16799,6 +16799,28 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue")
@TestDataPath("$PROJECT_ROOT")
public class GenericUnderlyingValue {
@Test
public void testAllFilesPresentInGenericUnderlyingValue() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue/simple.kt");
}
@Test
@TestMetadata("upperBound.kt")
public void testUpperBound() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue/upperBound.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
@TestDataPath("$PROJECT_ROOT")
@@ -14227,6 +14227,29 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
}
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class GenericUnderlyingValue extends AbstractIrCodegenBoxWasmTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
}
public void testAllFilesPresentInGenericUnderlyingValue() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue/simple.kt");
}
@TestMetadata("upperBound.kt")
public void testUpperBound() throws Exception {
runTest("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue/upperBound.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/inlineClasses/hiddenConstructor")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)