Skip to content

fix: create or modify can turn a local variable into a same-named parameter - #2749

Merged
ako merged 1 commit into
mainfrom
claude/issue-triage-prioritization-24rqgv
Dec 2, 2026
Merged

ako merged 1 commit into
mainfrom
claude/issue-triage-prioritization-24rqgv

Conversation

@ako

@ako ako commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Fixes #2726 (upstream mendixlabs#2002).

Problem

create or modify microflow refused a common refactor under mdl 1 (MDL-V1-REBUILD): moving a local list to the caller. That means adding the parameter $SaleList: List of M.Sale and removing the create list that declared it. The refusal read "drop $SaleList: $SaleList is still used by: add $NewSale to $SaleList", although the new parameter supplies $SaleList. With any other parameter name the same change spliced.

Fix

alterFlowContext.checkOutputUnused counted the dropped producer's stored readers. It exempted only a variable that an operation's fragment declares again. When the header changes, planFlowModify already gives a.mf the declared parameters. Now a variable that one of those parameters declares is not "left without its producer" either (isParameter).

Evidence

  • Test first: mdl/executor/flow_modify_local_to_parameter_2726_test.go failed with the reported message before the fix.
    • Its control still refuses the reader when the parameter is named differently.
    • It runs through ExecuteProgram. Executor.Execute does not apply the mdl 1; header, and under mdl 0 a refused splice falls back to a rebuild, so it would not have reproduced the bug.
  • Live, Mendix 11.12.6, the reporter's script:
    • The pre-fix binary refuses it.
    • After the fix it splices ("2 dropped; set: parameter $SaleList added"), and describe shows the declared flow.
    • A re-run reports Unchanged, and mx check reports 0 errors.
  • make ci-local passed.

Generated by Claude Code

…ameter

Moving a local list to the caller (a parameter $SaleList added, the
`create list` that declared it removed) was refused under mdl 1: "drop
$SaleList: $SaleList is still used by: add $NewSale to $SaleList". The
splice counted the dropped producer's readers without seeing that the
flow it writes has a parameter of that name, which is what they read.

Fixes #2726

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
@ako
ako merged commit 0c12814 into main Dec 2, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants