Skip to content

Keep our enum default as the user set it, since MATLAB has no one rule - #36

Merged
ww-mw merged 1 commit into
mainfrom
enum-default-removal-decision
Sep 17, 2026
Merged

ww-mw merged 1 commit into
mainfrom
enum-default-removal-decision

Conversation

@ww-mw

@ww-mw ww-mw commented Sep 17, 2026

Copy link
Copy Markdown
Member

Follow-up to #35, docs only.

#35 measured what MATLAB does when you delete the enumeral that an enum's
DefaultValue names, and wrote the result up as an open defect on our side with a
fix identified. That framing is now wrong: the decision is to keep our behaviour.

The reason is in the measurement itself — the two dictionary flavours disagree:

Design Data Arch Data
remove the default enumeral name left dangling on the live object DefaultValue reads the first survivor at once
on save invalid key dropped invalid key dropped

They agree only after a save, so there is no single MATLAB behaviour to mirror.
We hold the name the user chose; MATLAB repairs it silently on load in both
.sldd formats (verified in #35: opens clean, DefaultValue reads '', no
warning). That makes this a display/round-trip fidelity gap, not corruption.

This commit records the decision, names the two consequences a future reader would
otherwise file as bugs (no enumeral carries the "current" icon while the default
dangles; the select editor can display a value outside its own option list), and
keeps the one-line change that would align us, in case it is ever revisited. The
last-enumeral and enumeral-rename entries get the same treatment for the same
reason.

No source change, so dist/ is untouched and no version bump is needed.

The measurement recorded alongside this doc left the removal-of-the-default case
written up as an open defect with a fix identified. It is not a defect we intend
to fix: design data and architectural data disagree with each other about what
happens to DefaultValue when its enumeral is deleted -- one leaves the name
dangling on the live object, the other clears it immediately -- and they converge
only after a save. Copying either would mean choosing a winner between two
inconsistent references.

So we hold the name the user chose and let MATLAB apply its own repair on load,
which it does silently in both .sldd formats. Record that as the decision, name
the two consequences a future reader will otherwise mistake for bugs (no enumeral
carries the "current" icon while the default dangles, and the select editor can
show a value outside its own options), and say what would have to change if this
is ever revisited.

The last-enumeral and rename entries get the same treatment for the same reason.
@ww-mw
ww-mw merged commit 7e13e2d into main Sep 17, 2026
1 check passed
@ww-mw
ww-mw deleted the enum-default-removal-decision branch September 17, 2026 15:07
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.

1 participant