[FIR] Create proper error name references for invoke receivers

In this example, when processing
the `jso` property candidate form
the `dynamic` scope we get
`DslScopeViolation`.
When we later create the
receiver for the invoke call
(since we still call `jso {}` as
a function), we create a non-error
named reference which fails at
`toResolvedReference()`.

The included test should not fail
with exception.

^KT-65255 Fixed
This commit is contained in:
Nikolay Lunyak
2024-02-02 12:54:54 +02:00
committed by Space Team
parent be6ab943f4
commit 183c263c55
5 changed files with 46 additions and 5 deletions
@@ -25,6 +25,12 @@ public class FirLightTreeJsOldFrontendDiagnosticsTestGenerated extends AbstractF
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib"), Pattern.compile("^([^_](.+))\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("candidateNotSuccessfulButNoContradiction.kt")
public void testCandidateNotSuccessfulButNoContradiction() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJsStdLib/candidateNotSuccessfulButNoContradiction.kt");
}
@Test
@TestMetadata("dynamicUnresolved.kt")
public void testDynamicUnresolved() throws Exception {
@@ -25,6 +25,12 @@ public class FirPsiJsOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiJ
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib"), Pattern.compile("^([^_](.+))\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("candidateNotSuccessfulButNoContradiction.kt")
public void testCandidateNotSuccessfulButNoContradiction() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJsStdLib/candidateNotSuccessfulButNoContradiction.kt");
}
@Test
@TestMetadata("dynamicUnresolved.kt")
public void testDynamicUnresolved() throws Exception {
@@ -25,6 +25,12 @@ public class DiagnosticsWithJsStdLibTestGenerated extends AbstractDiagnosticsTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib"), Pattern.compile("^([^_](.+))\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("candidateNotSuccessfulButNoContradiction.kt")
public void testCandidateNotSuccessfulButNoContradiction() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJsStdLib/candidateNotSuccessfulButNoContradiction.kt");
}
@Test
@TestMetadata("dynamicUnresolved.kt")
public void testDynamicUnresolved() throws Exception {