Allow empty type info for excl expressions

^KT-34515 Fixed
This commit is contained in:
Victor Petukhov
2021-09-07 12:17:30 +03:00
committed by teamcity
parent b6f2513dd2
commit 7e491edf95
8 changed files with 36 additions and 1 deletions
@@ -4942,6 +4942,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesWithConstantsInAnnotation.kt");
}
@Test
@TestMetadata("kt34515.kt")
public void testKt34515() throws Exception {
runTest("compiler/testData/diagnostics/tests/collectionLiterals/kt34515.kt");
}
@Test
@TestMetadata("noCollectionLiterals.kt")
public void testNoCollectionLiterals() throws Exception {
@@ -4942,6 +4942,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesWithConstantsInAnnotation.kt");
}
@Test
@TestMetadata("kt34515.kt")
public void testKt34515() throws Exception {
runTest("compiler/testData/diagnostics/tests/collectionLiterals/kt34515.kt");
}
@Test
@TestMetadata("noCollectionLiterals.kt")
public void testNoCollectionLiterals() throws Exception {
@@ -4942,6 +4942,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
runTest("compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesWithConstantsInAnnotation.kt");
}
@Test
@TestMetadata("kt34515.kt")
public void testKt34515() throws Exception {
runTest("compiler/testData/diagnostics/tests/collectionLiterals/kt34515.kt");
}
@Test
@TestMetadata("noCollectionLiterals.kt")
public void testNoCollectionLiterals() throws Exception {
@@ -861,7 +861,9 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
context.trace.report(diagnosticFactory.on(operationSign));
return baseTypeInfo != null ? baseTypeInfo : components.expressionTypingServices.getTypeInfo(baseExpression, context);
}
assert baseTypeInfo != null : "Base expression was not processed: " + expression;
if (baseTypeInfo == null) {
return TypeInfoFactoryKt.noTypeInfo(context);
}
KotlinType baseType = baseTypeInfo.getType();
if (baseType == null) {
return baseTypeInfo;
@@ -0,0 +1,3 @@
fun main() {
<!UNSUPPORTED!>[]<!><!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>!!
}
@@ -0,0 +1,3 @@
fun main() {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, UNSUPPORTED!>[]<!>!!<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}
@@ -0,0 +1,3 @@
package
public fun main(): kotlin.Unit
@@ -4948,6 +4948,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/collectionLiterals/defaultValuesWithConstantsInAnnotation.kt");
}
@Test
@TestMetadata("kt34515.kt")
public void testKt34515() throws Exception {
runTest("compiler/testData/diagnostics/tests/collectionLiterals/kt34515.kt");
}
@Test
@TestMetadata("noCollectionLiterals.kt")
public void testNoCollectionLiterals() throws Exception {