Skip to content

IF empty($List) is rejected with a code-less, location-less "Unexpected token after expression" — printed AFTER a green 0 errors verdict #1042

Description

@marclehane-creator

Found in the agent evaluation (our harness evaluation row 13, corrected finding 9) and
reproduced in isolation on the isolation probe:

CREATE MICROFLOW Bench.Probe_EmptyList ($Customer: Bench.Customer) RETURNS Integer BEGIN
  RETRIEVE $Orders FROM Bench.Order WHERE Bench.Order_Customer = $Customer AND Status = 'Open';
  IF empty($Orders) THEN
    RETURN 0;
  END IF;
  RETURN length($Orders);
END;

check p1-empty.mdl -p MdlBenchFixture.mpr --references prints, in this order:

✓ Syntax OK (1 statements)
…
✓ All references valid
…
1 issues: 0 errors, 0 warnings, 1 info        ← (in the row-13 transcript; a green verdict line)
(no module)
  ✗ Unexpected token after expression — the expression appears incomplete or malformed (possible missing space between keywords). []
      at
      → Check for glued keywords such as 'emptyor' (should be 'empty or') or 'andtrue' (should be 'and true').
1 issues: 1 errors, 0 warnings, 0 info

Exit code 1 — the verdict is correct. Three things are not: (1) the error has an empty code
[], an empty at, and no line number
, so a reader (human or model) cannot find it in a 40-line
script; (2) the hint is about glued keywords, which is not the cause — empty is an object test
and the list form is length($List) = 0; (3) a green N issues: 0 errors block can precede it, so
anyone reading the FIRST verdict line records a pass. The eval write-up did exactly that for twelve
hours. Same family as the apostrophe case (reference_mxcli_mdl_authoring_traps): the message is
emitted from the expression re-parser without the statement's position. Ask: attach the document
and line, give it a code, and mention length() in the hint when the token is empty(.


mxcli 0.20.0, Mendix 11.12.x, Windows 11. Found while evaluating a self-hosted agent loop that drives check → check --references → exec → mx check; each item above was reproduced on a fresh copy of the fixture or app named.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions