JVM IR: fix isMarkedNullable for nullability-flexible types

Since nullability-flexible types in IR are represented by an annotation
on an IrSimpleType, not a special instance, the common implementation of
`KotlinTypeMarker.isMarkedNullable` in `TypeSystemContext` doesn't work.

This method is used for example to generate `typeOf` in JVM IR, in
`TypeSystemCommonBackendContext.generateTypeOf`, and this issue led to a
difference in behavior of `typeOf` for nullability-flexible types.

 #KT-44726 Fixed
This commit is contained in:
Alexander Udalov
2021-02-19 22:38:55 +01:00
parent 08cf78fafd
commit e6476c39ca
6 changed files with 53 additions and 0 deletions
@@ -35417,6 +35417,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/reflection/typeOf/classes.kt");
}
@Test
@TestMetadata("flexibleType.kt")
public void testFlexibleType() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/flexibleType.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
@@ -35417,6 +35417,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/reflection/typeOf/classes.kt");
}
@Test
@TestMetadata("flexibleType.kt")
public void testFlexibleType() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/flexibleType.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {