ModelingToolkit.jl icon indicating copy to clipboard operation
ModelingToolkit.jl copied to clipboard

Fix updating default value metadata of conditional parameters

Open ven-k opened this issue 1 year ago • 0 comments

This fixes the bug in populating structure dict for defaults of conditional parameters

Fixes:

julia> a = true; @mtkmodel A begin
                  @parameters begin
                      if a
                          b = 2, [description = "sjodf"]
                      end
                  end
              end
ERROR: LoadError: ArgumentError: invalid index: :b of type Symbol

Checklist

  • [x] Appropriate tests were added
  • [x] Any code changes were done in a way that does not break public API ~- [ ] All documentation related to code changes were updated~
  • [x] The new code follows the contributor guidelines, in particular the SciML Style Guide and COLPRAC. ~- [ ] Any new documentation only uses public API~

Additional context

No doc changes are required.

ven-k avatar Jan 30 '24 10:01 ven-k