shorthand: rebuild the importance-stripped declaration - #298
Open
samoht wants to merge 2 commits into
Open
Conversation
Pins that [same_value] ignores importance, so a value repeated with !important collapses instead of surviving as a legacy fallback.
A record update kept the hash the smart constructor had computed over the importance being cleared, so a value repeated with !important compared unequal and read as a legacy vendor fallback.
samoht
force-pushed
the
importance-rebuild-hash
branch
from
August 4, 2026 04:25
906b72e to
c241b77
Compare
This was referenced Aug 4, 2026
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.
Stacked on #297 (chain: #295 → #297 → #298 → #299). Review the last two commits; the rest is the base.
without_importancebuiltDeclaration { r with important = false }, copying the cachedhashfield that was computed over(property, value, important)— so the copy carried a fingerprint of the importance it had just cleared.same_valuecompares with polymorphic=, which walks that field, solegacy_vendor_fallback'snot (same_value ...)guard read two equal values as different:The equal-importance pair collapsed correctly all along; only the pair differing in importance leaked through.
Impact is output size — the wrong answer keeps a redundant declaration, and no mis-hashed declaration escapes the module — but a record update on a type whose smart constructor is meant to be the sole path is a landmine. Both arms now rebuild through
Declaration.vandDeclaration.theme_guarded, which recompute the hash; that is the shapeDeclaration.importantalready used two lines away.