Repository navigation
fix: preserve TypeScript initializer types through satisfies - #5
Merged
NianJiuZst merged 2 commits intoNov 2, 2026
Merged
NianJiuZst merged 2 commits into
NianJiuZst merged 2 commits into
Conversation
Owner
|
Please Allow edits from maintainers |
Contributor
Author
|
Sryyyy, I forgot to enable it when I submitted the PR. Now is ok |
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.
satisfiescurrently shares theasextraction rule and replaces the initializer's type with the constraint. For example,const service = new Service() satisfies Runnerlinksservice.run()toRunner::runand losesService::extra, even though the concrete receiver remainsService.Treat
satisfies_expressionas a transparent wrapper when collecting initializer evidence. Explicit annotations and innerasassertions keep their existing behavior. Factory call evidence is preserved without expanding the existing factory return-type inference. This follows TypeScript's documented semantics.Bump the engine rules from 4 to 5 so existing indexes refresh their stored facts on sync. The snapshot format is unchanged.
Validation
890912cand pass with the fix.as, explicit annotations, unknown operands and class fields.asassertion and restoration against full rebuilds, without taking the full-rebuild fallback.CGR_SYNC_SEQUENCES=6 CGR_SYNC_STEPS=100 cargo test --locked --workspace: 140 passed, 1 existing ignored.