With `dryRun` / `batchScriptErrors`, an error inside an action body makes the check skip the statements that follow the action: their errors are not reported, and their declarations are lost, producing phantom "is not found" errors

Open
#1,808 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
compilers

Research direction

Reproduce the minimal ZReproF module through settings.dryRun, then trace compiler handling of unresolved action-body calls and subsequent property registration. Compare the reported result with the expected single error; done means declarations after the faulty action remain usable or consequential errors are suppressed.

Written by the indexing model from the issue text.

Description

Description

When the logic is checked with several errors per run (dryRun, or the batchScriptErrors working parameter, #1797), an error inside the body of an action does not resume the check at the next statement. Everything after that action, up to the end of the next statement that ends with ;, is skipped - whole correct actions and the first property after them included. Three things follow:

  1. Real errors are lost. Errors in the skipped statements are not reported, although they do not depend on the first one in any way.
  2. Phantom errors appear. The skipped statements are not declared, so a later, correct use of them is reported as ... is not found, even though they are declared correctly and earlier than their use.
  3. It cascades. When such a phantom error lands inside another action body, the skipping starts again from there, which is how one mistake turns into errors scattered over the whole module.

It does not matter what the error in the body is: an unknown name, or an existing name called with a wrong signature (for example an unbracketed OVERRIDE in an argument list - target(a, OVERRIDE f(a), 0, 5) - whose comma reshapes the argument list). An error in a statement that ends with ; - a property, for instance - does not do this: the check resumes right after it.

The practical cost is diagnostic. In a real ~330-line module a single mistake (that unbracketed OVERRIDE) produced 6 errors, 5 of them phantom, scattered across the whole file - including a component 'BOX(dl)' is not found from the form section. Fixing the single real error removed all six. In the reported list the root cause is not distinguishable from its consequences, which sent me looking for a non-existent second bug. The opposite also happens: two independent mistakes in two actions are reported one per run, as if the option were off.

Version: 7.0-SNAPSHOT (first seen on build 392, still there on master of 2026-09-21), Java 17, Windows. Reproduced via settings.dryRun.

Minimal reproduction
MODULE BatchErrors;

REQUIRE System;

first() { MESSAGE unknownOne(); }     // error 1
second() { MESSAGE 'ok'; }            // correct
third() { MESSAGE unknownTwo(); }     // error 2
counter = DATA INTEGER ();            // correct
fourth() { second(); }                // correct
fifth = unknownThree();               // error 3
Actual
[error]:
	BatchErrors:5:30 property or action 'unknownOne[]' is not found
[error]:
	BatchErrors:9:19 action 'second[]' is not found

After line 5 the check skips second, third and counter; fourth then fails on the missing second, and that failure in turn skips fifth.

Expected

The three real errors - lines 5, 7 and 10 - and nothing about second, which is declared at line 6 and used at line 9.

The same three mistakes written as properties are reported exactly like that:

first = unknownOne();                 // error 1
second = 1;                           // correct
third = unknownTwo();                 // error 2
counter = DATA INTEGER ();            // correct
fourth = second();                    // correct
fifth = unknownThree();               // error 3
[error]:
	BatchErrors:5:20 property or action 'unknownOne[]' is not found
[error]:
	BatchErrors:7:20 property or action 'unknownTwo[]' is not found
[error]:
	BatchErrors:10:22 property or action 'unknownThree[]' is not found
Isolation

What decides it is how the statement with the error ends. In each variant the faulty statement is followed by second = unknownTwo(); and third = unknownThree();:

statement with the error ends with second third
action a() { noSuchAction(); } } skipped, its error is lost reported
DESIGN f { NEW box1 { MOVE BOX(noSuchObject); } } } skipped, its error is lost reported
NAVIGATOR { NEW noSuchForm; } } skipped, its error is lost reported
ON { noSuchAction(); } } skipped, its error is lost reported
a() + { noSuchAction(); } } skipped, its error is lost reported
property a = noSuchProperty(); ; reported reported

This also narrows the first version of this report, which said that every property declared after the faulty action fails to register while actions declared after it are unaffected. What is skipped is the stretch from the faulty statement to the end of the next statement that ends with ;: the actions inside it are lost as well, and the properties after it are declared normally. An action looked unaffected there only because the form that used it was skipped together with it.

Reason

The point of this mode is to get the list of what is wrong in one run instead of one restart per mistake (#1797). Action bodies hold most of the code of a module, and so most of its mistakes, and it is exactly there that the mode falls back to one error per run - while adding errors that do not exist. Whoever fixes the logic, a developer or an assistant, reruns the check and gets a different list each time, or goes looking for a second bug that is not there.

Fix

After an error inside an action - or inside any other statement that ends with its closing } rather than with ; - the check resumes at the statement that follows it: the errors of that statement are reported and its declarations are kept, so no phantom errors appear.

Dominant language
Java
Stars
214
Forks
46
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lsfusion/platform

All issues in lsfusion/platform

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.