Repository navigation
Refuse set $Obj = … on object variables (mendixlabs/mxcli#1323) - #1011
Merged
Merged
Conversation
`set $Cursor = $Next;` with both variables single objects passed `check --references` and `exec` and was written as a Change variable action, which mxbuild refuses with CE7247 "Variable 'Cursor' does not have a primitive type". Mendix has no action that reassigns an object variable; #949 routed the list case to Change list Replace and left objects on the primitive-only path. The builder (exec) and the check validator now refuse it and name the alternatives. The check validator typed every association retrieve as a list, so the reported shape (a Reference followed from its FROM entity) looked like a list to check; under --references it now takes the association shapes MDL-ASSOCDS01 already builds and types that retrieve as the object it is. Self-association retrieves stay lists (Mendix types them so, and `set` on them is a valid Replace). Measured on 11.14.0: faulted build -> CE7247; fixed build refuses in check and exec; the self-association and recursive sub-microflow forms in the bug-test -> 0 errors. Fixes mendixlabs#1323 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PMEw8qsiJuVoaaGJawicfo
…project Plain `mxcli check` runs only the MDL0xx rule set, never validateFlowBody, so the mendixlabs#1323 refusal reached `check --references` and `exec` but not a check without -p (and check-mdl could not pin it with a .fail.mdl). MDL-SET01 judges the object producers visible in the text: entity parameters, create, `retrieve … first`, loop iterators over a known list, head, cast. Association retrieves need the project and stay with validateFlowBody, which now reports only those, so --references prints the refusal once. Microflows and nanoflows. Measured on 11.14.0 with the faulted build: every producer gives CE7247; a parameter is worded "Parameter 'A' cannot be changed.", which the message now quotes. Part of mendixlabs#1323 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PMEw8qsiJuVoaaGJawicfo
…ariable # Conflicts: # CHANGELOG.md
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.
Summary
Fixes mendixlabs#1323. Reported symptom:
set $Cursor = $Next;on two object variables passedcheck --referencesandexec, thenmx checkfailed with CE7247 "Variable 'Cursor' does not have a primitive type." Mendix has no action that reassigns an object variable (Change variable takes only primitives; lists use Change list Replace, #949). mxcli now refuses it on every path:check(no project)validate_microflow_set_object.go(microflows and nanoflows)create,retrieve … first, loop iterators,head, castcheck --referencesvalidateFlowBody, now givencheckAssociationShapes(ctx, sc)execflowBuilder.refuseSetOnObject--no-checkSelf-associations, reverse traversals and ReferenceSets stay lists, so
seton them is still a valid Replace.Evidence
mdl/executor/set_object_variable_test.gocovers the issue's script verbatim, each producer, a nanoflow, and controls (primitive, list, member path, association retrieve without a project, reverse Reference, ReferenceSet).seton object variable $Cursor". With MDL-SET01 stubbed out, every plain-check test fails.mx checkreports the exact CE7247. Each MDL-SET01 producer and a nanoflow also give CE7247. A parameter is worded"Parameter 'A' cannot be changed.", and the message quotes that.mdl-examples/bug-tests/1323-set-object-variable.mdlholds the forms that build, and1323-set-object-variable.fail.mdlholds the refusal.make check-mdlpasses.make check-findingspasses.make build,make test,make lint(including conformance) andmake check-skill-mdlpass after mergingmain.Not in scope
A primitive parameter (
set $N = 1on$N: Integer) also fails with CE7247 "Parameter 'N' cannot be changed." and is still not refused. That's queued as a separate task.🤖 Generated with Claude Code
https://claude.ai/code/session_01PMEw8qsiJuVoaaGJawicfo