fix(mdl): refuse throw, float/currency/date and the parenthesised association; warn on unstored index names and enum-value docs - #724
Merged
Conversation
… text Five forms passed `check` and were then lost or stored as something else (#706). Split by what is lost: Refused in the visitor, with the working spelling in the message, because the written model would be wrong: - `throw <expr>` had no listener and vanished from the microflow. - `float` / `currency` fell through to String (Void in a microflow); `date` became DateTime. Checked on EnterDataType/EnterNonListDataType, so every place a type is written is covered, and only the direct token: `M.Currency` and `enumeration(M.Float)` stay legal. - `create association X (from A to B, type: …, storage: …)` read none of its options; a ReferenceSet was stored as a Reference. Warned by check, because the model is right and only words are lost: - MDL-IDX01: an index name (a Mendix index is anonymous). - MDL-ENUMDOC01: a doc comment on an enumeration value. The grammar alternatives stay as rejection anchors: the words are also keywords-as-identifiers, so deleting them would let `Amount: float` re-parse as an enumeration reference named float. Closes #706 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… examples The examples relied on the forms #706 refuses or warns about: enum-value doc comments become `--` comments, `date` attributes become datetime, and the widget demo's parenthesised association is written in the working form — it now really is the ReferenceSet it always said it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #706. Plan item 0.3 (the §2 silent drops) of
PROPOSAL_mdl_beta_syntax_freeze.md, tracked in #714.What was wrong
Before this change, each of these got
✓ Syntax OKandCheck passed!frommxcli check, and was then lost or stored wrongly:throw 'x';raise error;inside anon errorhandler, or a Java action on the main flowAmount: float/currencyDecimalBorn: dateDateTime(Mendix has no date-only type)create association X (from A to B, type: referenceset, storage: table)/** … */on an enumeration valueMDL-ENUMDOC01index Idx on (…),add index Idx (…),create index Idx on E (…))MDL-IDX01Design choices the ADRs did not settle
create indexrequires a name. Both therefore warn: throughValidateProgram,execprints the warnings as well. Making them errors under anmdl 1;header can come later through the deprecation registry.float,currency,dateandthroware also accepted as keywords-as-identifiers. Deleting| FLOAT_TYPEfromdataTypewould letAmount: floatparse again as an enumeration reference namedfloat, which is the same silent failure. The alternatives stay as rejection anchors with exactline:colerrors. Proposal item 2.3 can delete them once a hint mechanism for removed syntax exists.EnterDataType/EnterNonListDataType, which covers attributes, microflow parameters and returns,declare, constants and the service rules. It looks only at the direct token, soM.Currencyandenumeration(M.Float)still parse (there is a control test for this).--comment, or the enumeration's own/** */.Test plan (what I ran)
mdl/visitor/silent_drops_706_test.goandmdl/executor/validate_unstored_text_test.go. Every rejection test has a control next to it (canonical association keeps ReferenceSet/Table,decimal/datetime/M.Currencystill parse, the enumeration's own doc comment is stored, anonymous indexes and drop-by-columns do not warn).ExitThrowStatement,EnterDataType/EnterNonListDataType, theLPARENbranch of the association visitor, thevalidateIndexNames/validateEnumValueDocswiring, or the index-name / value-doc capture makes the matching test fail. Restoring the fix makes it pass.mxcli checkon a script with all six forms printed "Syntax OK (5 statements) / Check passed!". After the fix it gives four errors with the replacement spelling, and the two text-only forms give warnings.checkover every file ingit ls-files '*.mdl'and compared exit codes. Five example files depended on the dropped forms. They are fixed in the second commit; the widget demo's association now really is the ReferenceSet it declared.make build,make lintandmake check-findingspass. Inmake test, every package passed exceptmdl/backend/modelsdk, which hit Go's 10-minute default timeout (load average above 20, with several agents compiling on the same machine). Rerun alone with-timeout 40mit passes (ok … 660.9s). This change does not touch that package..claude/skills/fix-issue/findings/mdl-visitor.jsonl.Follow-ups (not in this PR)
ast.TypeDateand its writer, describer and diff branches are now unreachable from the parser and can be deleted.DataTypes$FloatTypedescribes astype Float, which is now refused on re-exec. It used to become a String silently. If such models exist in the wild, describe should map it to Decimal.AutoOwner-style attributes (proposal §2 item 11) is covered by MDL022 and was not changed here.🤖 Generated with Claude Code