K2: report empty intersection warnings from completion properly
This commit is contained in:
committed by
Space Team
parent
47fab61716
commit
a3f0e429e3
+6
@@ -18325,6 +18325,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/fir/differentSinceKotlin.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("emptyIntersectionWarning.kt")
|
||||
public void testEmptyIntersectionWarning() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExtensionAlias.kt")
|
||||
public void testExtensionAlias() throws Exception {
|
||||
|
||||
+6
@@ -18325,6 +18325,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/fir/differentSinceKotlin.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("emptyIntersectionWarning.kt")
|
||||
public void testEmptyIntersectionWarning() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/emptyIntersectionWarning.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ExtensionAlias.kt")
|
||||
public void testExtensionAlias() throws Exception {
|
||||
|
||||
+2
-1
@@ -802,8 +802,9 @@ class FirCallCompletionResultsWriterTransformer(
|
||||
return varargArgumentsExpression
|
||||
}
|
||||
|
||||
// TODO: report warning with a checker and return true here only in case of errors
|
||||
private fun FirNamedReferenceWithCandidate.hasAdditionalResolutionErrors(): Boolean =
|
||||
candidate.system.errors.any { it is InferredEmptyIntersection && it.kind.isDefinitelyEmpty }
|
||||
candidate.system.errors.any { it is InferredEmptyIntersection }
|
||||
|
||||
private fun FirNamedReferenceWithCandidate.toResolvedReference(): FirNamedReference {
|
||||
val errorDiagnostic = when {
|
||||
|
||||
Reference in New Issue
Block a user