Skip to content

Fix variable shadowing in nested map/list deserialization code generation#3729

Merged
pulimsr merged 1 commit intomainfrom
fix-nested-map-variable-shadowing
Feb 23, 2026
Merged

Fix variable shadowing in nested map/list deserialization code generation#3729
pulimsr merged 1 commit intomainfrom
fix-nested-map-variable-shadowing

Conversation

@pulimsr
Copy link
Contributor

@pulimsr pulimsr commented Feb 23, 2026

Description of changes: Fixed variable shadowing in the code generator template for nested map/list deserialization. The template now appends recursion depth to variable names when processing nested structures, preventing MSVC C4456 warnings that are treated as errors.

Changes to ModelInternalMapOrListJsonDeserializer.vm:

  • Append recursion depth to variable names when depth > 1
  • Update internal collection names to include recursion depth for both map values and list members
  • Ensures unique variable names at each nesting level (e.g., conditionJsonMap, condition2JsonMap, condition3JsonList)

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@pulimsr pulimsr merged commit 0cbad6f into main Feb 23, 2026
5 checks passed
@pulimsr pulimsr deleted the fix-nested-map-variable-shadowing branch February 23, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants