Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler Internal Error: Impossible here, static method get should be caught when translating application #10473

Closed
jdunkerley opened this issue Jul 8, 2024 · 16 comments · Fixed by #10756

Comments

@jdunkerley
Copy link
Member

Image

Add a unconnected component

node3 = get 1

And you get the above internal error and things don't work right

@github-project-automation github-project-automation bot moved this to ❓New in Issues Board Jul 8, 2024
@jdunkerley jdunkerley added this to the 2024-08 Release milestone Jul 8, 2024
@JaroslavTulach JaroslavTulach self-assigned this Jul 9, 2024
@JaroslavTulach JaroslavTulach changed the title Bug: Internal Error Compiler Internal Error: Impossible here, static method get should be caught when translating application Jul 9, 2024
@JaroslavTulach JaroslavTulach moved this from ❓New to 📤 Backlog in Issues Board Jul 9, 2024
@JaroslavTulach
Copy link
Member

It would be interesting to know the whole source code. Without the source code, I can only guess what could be the problem. Trying to parse:

node3 = get 1

yields:

e.enso:1:9: error: The name `get` could not be found.
    1 | node3 = get 1
      |         ^~~

that's correct.

@JaroslavTulach
Copy link
Member

JaroslavTulach commented Jul 11, 2024

This is the failing test:

diff --git engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java
index d83891b7b5..b2ebe5bc4f 100644
--- engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java
+++ engine/runtime-integration-tests/src/test/java/org/enso/compiler/ExecCompilerTest.java
@@ -90,6 +90,25 @@ public class ExecCompilerTest {
     }
   }
 
+  @Test
+  public void testDoubleAssignmentError() throws Exception {
+    var module =
+        ctx.eval(
+            LanguageInfo.ID,
+            """
+    from Standard.Base import all
+
+    main =
+        node1 = node3 = get 3
+    """);
+    try {
+      var run = module.invokeMember("eval_expression", "main");
+      fail("Unexpected result: " + run);
+    } catch (PolyglotException ex) {
+      assertEquals("", ex.getMessage());
+    }
+  }
+
   @Test
   public void testDesugarOperatorsLeftRight() throws Exception {
     var module = ctx.eval(LanguageInfo.ID, """

it was actually pretty tricky to find the test case, as the same program yields normal compilation errors when executed from CLI. One really has to run in IDE's "non-strict errors" mode.

@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to ⚙️ Design in Issues Board Jul 11, 2024
@JaroslavTulach
Copy link
Member

JaroslavTulach commented Jul 11, 2024

@kaz, the node3 = get 3 in node1 = node3 = get 3 is represented as application of function/operator named =. Is that desirable? Shouldn't = be a reserved keyword and not an operator?

The question is who should reject that syntax? parser? TreeToIr? Or some later phase in the compiler?

The error is yielded from here and I can generate better syntax error, but possibly we should not even get to this place.

@kazcw
Copy link
Contributor

kazcw commented Jul 11, 2024

That would be a syntax error. Only the parser should create syntax errors.

@enso-bot
Copy link

enso-bot bot commented Jul 20, 2024

Keziah Wesley reports a new STANDUP for yesterday (2024-07-18):

Progress: Finished implementation; updated libraries; added new linter to run tool and CI. It should be finished by 2024-07-24.

Next Day: Next day I will be working on the #10473 task. Refactored syntactic-operators. Started working toward parser-only separation of tree type by contexts.

@enso-bot
Copy link

enso-bot bot commented Jul 20, 2024

Keziah Wesley reports a new STANDUP for today (2024-07-19):

Progress: Introducing wrapper types for contexts and unifying context management around the new type conversions. It should be finished by 2024-07-24.

Next Day: Next day I will be working on the #10473 task. Continue refactoring contextualizing logic into the wrapper operations.

@enso-bot
Copy link

enso-bot bot commented Jul 24, 2024

Keziah Wesley reports a new STANDUP for yesterday (2024-07-22):

Progress: Refactored syntactic operators. It should be finished by 2024-07-24.

Next Day: Next day I will be working on the #10473 task. Continue contextualizing refactor.

@enso-bot
Copy link

enso-bot bot commented Jul 24, 2024

Keziah Wesley reports a new STANDUP for today (2024-07-23):

Progress: Implemented JNI bindings for warnings, worked on context PR. It should be finished by 2024-07-24.

Next Day: Next day I will be working on the #10473 task. Continue contextualizing refactor.

@enso-bot
Copy link

enso-bot bot commented Jul 26, 2024

Keziah Wesley reports a new STANDUP for yesterday (2024-07-24):

Progress: Deferred parsing of all blocks and groups until their context is known. Started implementing statement parser. It should be finished by 2024-07-24.

Next Day: Next day I will be working on the #10473 task. Continue contextualizing refactor.

@enso-bot
Copy link

enso-bot bot commented Jul 26, 2024

Keziah Wesley reports a new STANDUP for today (2024-07-25):

Progress: Implemented statement parser. It should be finished by 2024-07-31.

Next Day: Next day I will be working on the #10473 task. Eliminate remaining uses of OPR for non-expressions.

@enso-bot
Copy link

enso-bot bot commented Jul 29, 2024

Keziah Wesley reports a new STANDUP for the last Friday (2024-07-26):

Progress: Implemented type constructor and type-def parsers. It should be finished by 2024-07-31.

Next Day: Next day I will be working on the #10473 task. Recognize named-app syntax before applying operators.

@enso-bot
Copy link

enso-bot bot commented Jul 29, 2024

Keziah Wesley reports a new STANDUP for the last Friday (2024-07-26):

Progress: Moved group construction later and implemented earlier named-app recognition. Added a warning when a syntactic operator is misused in an expression. It should be finished by 2024-07-31.

Next Day: Next day I will be working on the #10473 task. Address lints, update some backend and JS tests.

@enso-bot
Copy link

enso-bot bot commented Jul 31, 2024

Keziah Wesley reports a new STANDUP for today (2024-07-30):

Progress: Testing. It should be finished by 2024-07-31.

Next Day: Next day I will be working on the #10473 task. Finish testing, updating backend tests.

@enso-bot
Copy link

enso-bot bot commented Aug 2, 2024

Keziah Wesley reports a new STANDUP for yesterday (2024-07-31):

Progress: Fixes for backend JVM tests, docs. It should be finished by 2024-07-31.

Next Day: Next day I will be working on the #10473 task. Finishing. Address some last lints.

@enso-bot
Copy link

enso-bot bot commented Aug 2, 2024

Keziah Wesley reports a new STANDUP for today (2024-08-01):

Progress: Standard library test in CI revealed a complex precedence issue, fixed it and PR is green. It should be finished by 2024-08-02.

Next Day: Next day I will be working on the #10473 task. Next task

@enso-bot
Copy link

enso-bot bot commented Aug 6, 2024

Keziah Wesley reports a new STANDUP for the last Friday (2024-08-02):

Progress: Implemented full named-application argument syntax, enabling misused-operator warnings. It should be finished by 2024-08-05.

Next Day: Next day I will be working on the #10473 task. Finish PR, start a GUI task.

@kazcw kazcw moved this from 🔧 Implementation to 👁️ Code review in Issues Board Aug 6, 2024
@mergify mergify bot closed this as completed in #10756 Aug 6, 2024
@mergify mergify bot closed this as completed in e47bdd3 Aug 6, 2024
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Aug 6, 2024
@farmaazon farmaazon moved this from 🟢 Accepted to 🗄️ Archived in Issues Board Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants