[NI] Check stub types in result type

An uninferred parameter stub may leak through calculation of CST(Inv<Uninferred Stub>, Nothing) into a result type.
A stub type in the result type means a type error. So we can afford recalculating
CST with stub-containing types filtered out, since its an error anyway.
This prevents stub types leakages and helps with reporting type error diagnostics.

KT-35914 Fixed
KT-35943 Fixed
This commit is contained in:
Pavel Kirpichenkov
2020-01-17 11:43:50 +03:00
parent 581db19544
commit cb0b44273d
17 changed files with 210 additions and 4 deletions
@@ -10868,6 +10868,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt");
}
@TestMetadata("notEnoughInformationAndNothing.kt")
public void testNotEnoughInformationAndNothing() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationAndNothing.kt");
}
@TestMetadata("notEnoughInformationFromNullabilityConstraint.kt")
public void testNotEnoughInformationFromNullabilityConstraint() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt");
@@ -11192,6 +11197,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
runTest("compiler/testData/diagnostics/tests/inference/regressions/kt35844.kt");
}
@TestMetadata("kt35943.kt")
public void testKt35943() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/regressions/kt35943.kt");
}
@TestMetadata("kt4420.kt")
public void testKt4420() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt");
@@ -10863,6 +10863,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt");
}
@TestMetadata("notEnoughInformationAndNothing.kt")
public void testNotEnoughInformationAndNothing() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationAndNothing.kt");
}
@TestMetadata("notEnoughInformationFromNullabilityConstraint.kt")
public void testNotEnoughInformationFromNullabilityConstraint() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/nothingType/notEnoughInformationFromNullabilityConstraint.kt");
@@ -11187,6 +11192,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/inference/regressions/kt35844.kt");
}
@TestMetadata("kt35943.kt")
public void testKt35943() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/regressions/kt35943.kt");
}
@TestMetadata("kt4420.kt")
public void testKt4420() throws Exception {
runTest("compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt");
@@ -25926,6 +25926,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/regressions/kt3587.kt");
}
@TestMetadata("kt35914.kt")
public void testKt35914() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt35914.kt");
}
@TestMetadata("kt3850.kt")
public void testKt3850() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt3850.kt");
@@ -24743,6 +24743,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/regressions/kt3587.kt");
}
@TestMetadata("kt35914.kt")
public void testKt35914() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt35914.kt");
}
@TestMetadata("kt3850.kt")
public void testKt3850() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt3850.kt");
@@ -24425,6 +24425,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/regressions/kt3587.kt");
}
@TestMetadata("kt35914.kt")
public void testKt35914() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt35914.kt");
}
@TestMetadata("kt3850.kt")
public void testKt3850() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt3850.kt");
@@ -24425,6 +24425,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/regressions/kt3587.kt");
}
@TestMetadata("kt35914.kt")
public void testKt35914() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt35914.kt");
}
@TestMetadata("kt3850.kt")
public void testKt3850() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt3850.kt");