Improve toString of platform types created by typeOf
In the stdlib implementation, render "!" if the type is only nullability-flexible. Otherwise, render "($lower..$upper)". Note that full kotlin-reflect has a much more complicated logic (see `DescriptorRendererImpl.renderFlexibleType`) that renders things like `(Mutable)List` and so on. It is not a goal of the stdlib implementation to replicate all of that, since it requires copying a large amount of code, namely the entirety of `JavaToKotlinClassMap` to map Java class names to Kotlin.
This commit is contained in:
+12
@@ -37479,6 +37479,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/nothing_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveJavaTypes.kt")
|
||||
public void testPrimitiveJavaTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/primitiveJavaTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("rawTypes_after.kt")
|
||||
public void testRawTypes_after() throws Exception {
|
||||
@@ -37564,6 +37570,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/nothing_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveJavaTypes.kt")
|
||||
public void testPrimitiveJavaTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/primitiveJavaTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("rawTypes_after.kt")
|
||||
public void testRawTypes_after() throws Exception {
|
||||
|
||||
+12
@@ -37521,6 +37521,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/nothing_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveJavaTypes.kt")
|
||||
public void testPrimitiveJavaTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/primitiveJavaTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("rawTypes_after.kt")
|
||||
public void testRawTypes_after() throws Exception {
|
||||
@@ -37606,6 +37612,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/nothing_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveJavaTypes.kt")
|
||||
public void testPrimitiveJavaTypes() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/primitiveJavaTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("rawTypes_after.kt")
|
||||
public void testRawTypes_after() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user