Repository navigation
fix: create or modify can turn a local variable into a same-named parameter - #2749
Merged
Merged
Conversation
…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
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.
Fixes #2726 (upstream mendixlabs#2002).
Problem
create or modify microflowrefused a common refactor undermdl 1(MDL-V1-REBUILD): moving a local list to the caller. That means adding the parameter$SaleList: List of M.Saleand removing thecreate listthat 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.checkOutputUnusedcounted the dropped producer's stored readers. It exempted only a variable that an operation's fragment declares again. When the header changes,planFlowModifyalready givesa.mfthe declared parameters. Now a variable that one of those parameters declares is not "left without its producer" either (isParameter).Evidence
mdl/executor/flow_modify_local_to_parameter_2726_test.gofailed with the reported message before the fix.ExecuteProgram.Executor.Executedoes not apply themdl 1;header, and under mdl 0 a refused splice falls back to a rebuild, so it would not have reproduced the bug.describeshows the declared flow.Unchanged, andmx checkreports 0 errors.make ci-localpassed.Generated by Claude Code