Repository navigation
test(native): cover an inherited cycle reached from two branches, and the compiler's cut - #422
Merged
danstepanov merged 2 commits intoDec 2, 2026
Conversation
Contributor
Author
No device frameThis PR adds tests only. |
YevheniiKotyrlo
force-pushed
the
fix/variable-resolution-cycle
branch
from
October 11, 2026 12:35
3ab7d96 to
f5913ae
Compare
sammoore
suggested changes
Dec 1, 2026
Contributor
There was a problem hiding this comment.
Appreciate keeping this open. From what I can tell, I think our existing tests cover these cases, with the exception of:
- "a cycle in a variable declared once is cut by the compiler"
- "one variable reached again from two branches of one value, inherited, drops the reading declaration"
Can we just keep those?
Contributor
Author
|
Trimmed to those two: "a cycle in a variable declared once is cut by the compiler" and "one variable reached again from two branches of one value, inherited, drops the reading declaration". |
sammoore
approved these changes
Dec 2, 2026
sammoore
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this!! LGTM.
…er's guard nativewind#451 cuts a custom-property cycle at runtime and in the compile-time inliner, and tests cycles declared on one element. A variable reaches a descendant unresolved, so a cycle can also close on the element that reads it: a variable that is itself, one reached again through a fallback, two that name each other, and one reached from two branches of one value. Each drops the declaration that reads it, as browsers do, while an unrelated variable still resolves. The other cases pin what must not read as a cycle: a variable read twice in one declaration, and a long inherited chain. The compiler cases pin that the inliner leaves a cycle for the runtime and still folds a chain.
main's tests already cover the other cases, so the branch keeps an inherited cycle reached from two branches of one value and a cycle in a variable declared once, which the compiler cuts.
danstepanov
force-pushed
the
fix/variable-resolution-cycle
branch
from
December 2, 2026 17:59
0d6421f to
537c1fa
Compare
danstepanov
approved these changes
Dec 2, 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.
Problem
main's cycle tests declare every cycle on the element that reads it. Two cases #451 cuts are left uncovered:Tests
src/__tests__/native/variable-cycles.test.tsxgains those two cases.Verification
A local replica of CI passes every job on Node 26.12.1, where
.nvmrcpins 24.22.3: lint and typecheck,yarn test --maxWorkers=2 --coverage(2238 passed), the library build withnode --test, the web export and commitlint in Ubuntu, and the iOS dev build on macOS with Xcode 27.2, whereci.ymlpins 26.6.