[FIR] fix subtyping for definitely notnull types.

The current implementation doesn't consider Foo a subtype of Captured<in
Foo>!!, since AbstractTypeCheckerContext::checkSubtypeForSpecialCases
does not handle DefinitelyNotNullType cases. This PR adds handling of
DefinitelyNotNullType by looking at its original type.

^KT-42824 Fixed
This commit is contained in:
Juan Chen
2020-10-27 04:18:31 +03:00
committed by Mikhail Glukhikh
parent eb804709da
commit 9486f58fb1
11 changed files with 79 additions and 14 deletions
@@ -13896,6 +13896,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/generics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("kt42824.kt")
public void testKt42824() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/generics/kt42824.kt");
}
@TestMetadata("kt42825.kt")
public void testKt42825() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/generics/kt42825.kt");
@@ -13896,6 +13896,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/generics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("kt42824.kt")
public void testKt42824() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/generics/kt42824.kt");
}
@TestMetadata("kt42825.kt")
public void testKt42825() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/generics/kt42825.kt");
@@ -13961,6 +13961,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/generics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("kt42824.kt")
public void testKt42824() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/generics/kt42824.kt");
}
@TestMetadata("kt42825.kt")
public void testKt42825() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/generics/kt42825.kt");