Tracking issue for the v0.13.0 milestone. Design: docs/11-proposals/PROPOSAL_expression_type_checking.md.
Problem
mxcli check is a syntactic validator today. It catches grammar errors but not type mismatches that produce silent wrong results or CE errors in Studio Pro. Examples that pass mxcli check today:
-- Silent wrong result: + is numeric add, not string concat
declare $Label string = 'Order #' + $Order/OrderNumber; -- OrderNumber is Integer
-- Silent empty results: enum compared as string literal
if $Order/Status = 'Open' then ... -- Status is enum; should be Module.OrderStatus.Open
-- Runtime CE0109: parseInteger expects String
declare $N integer = parseInteger($Count); -- $Count is Integer
Studio Pro catches these at design time; mxcli should too.
Scope
Microflows and nanoflows in this milestone. Pages and security rules use different expression contexts and are out of scope.
Two tiers:
| Tier |
Requires project? |
Examples |
| Scope-local |
No |
Variable type tracking, + overload mismatch, function argument count |
| Catalog-backed |
Yes (--references) |
Attribute type vs. comparison value, enum-in-expression vs. XPath, microflow return type |
Acceptance criteria
mxcli check reports type errors on all three examples above with actionable messages and line/column positions.
- The three example bugs each become a unit test in the type checker package, locking in detection.
- LSP surfaces scope-local errors as real-time diagnostics in VS Code (same channel as MDL-WIDGET01).
mxcli check --references extends to catalog-backed checks; passes silently without --references to avoid blocking offline use.
- New
mdl-examples/bug-tests/ fixtures cover each catch.
- Documentation: skill file at
.claude/skills/type-check.md plus docs-site page with the error code list (e.g. MDL-TYPE001..N).
Non-goals
- Type checking page expressions (different context, deferred to v0.14+).
- Type checking security XPath constraints (catalog-driven; partially covered already by entity-access validation).
- Inferring types Studio Pro itself cannot infer.
Out of milestone but related
Phases
The proposal proposes implementation in tiers:
- Scope-local type tracker — walks microflow/nanoflow body, builds a variable→type map per scope, validates expression and activity argument types against it.
- Function/operator type table — enumerate Mendix built-in functions with signature
(arg types) -> return type; check call sites against the table.
- Catalog-backed attribute/enum checks — when
--references is on, resolve $obj/Attr to a declared type from the catalog and validate downstream usage.
- LSP wiring — surface scope-local diagnostics in real time without project access.
- Catalog-backed LSP — opt-in when the catalog is loaded.
Each phase is independently shippable.
References
- Proposal:
docs/11-proposals/PROPOSAL_expression_type_checking.md
Tracking issue for the v0.13.0 milestone. Design:
docs/11-proposals/PROPOSAL_expression_type_checking.md.Problem
mxcli checkis a syntactic validator today. It catches grammar errors but not type mismatches that produce silent wrong results or CE errors in Studio Pro. Examples that passmxcli checktoday:Studio Pro catches these at design time; mxcli should too.
Scope
Microflows and nanoflows in this milestone. Pages and security rules use different expression contexts and are out of scope.
Two tiers:
+overload mismatch, function argument count--references)Acceptance criteria
mxcli checkreports type errors on all three examples above with actionable messages and line/column positions.mxcli check --referencesextends to catalog-backed checks; passes silently without--referencesto avoid blocking offline use.mdl-examples/bug-tests/fixtures cover each catch..claude/skills/type-check.mdplus docs-site page with the error code list (e.g.MDL-TYPE001..N).Non-goals
Out of milestone but related
Phases
The proposal proposes implementation in tiers:
(arg types) -> return type; check call sites against the table.--referencesis on, resolve$obj/Attrto a declared type from the catalog and validate downstream usage.Each phase is independently shippable.
References
docs/11-proposals/PROPOSAL_expression_type_checking.md