Keep our enum default as the user set it, since MATLAB has no one rule - #36
Merged
Merged
Conversation
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.
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.
Follow-up to #35, docs only.
#35 measured what MATLAB does when you delete the enumeral that an enum's
DefaultValuenames, and wrote the result up as an open defect on our side with afix 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:
DefaultValuereads the first survivor at onceThey 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
.slddformats (verified in #35: opens clean,DefaultValuereads'', nowarning). 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.