fix: handle accessors in declaration return types - #492
Open
neallin917 wants to merge 2 commits into
Open
Conversation
neallin917
marked this pull request as ready for review
July 29, 2026 05:06
Member
|
Hello @neallin917, can you add some tests to validate the fix. Also, please when using AI it would be nice to add a disclosure. |
Author
|
Thanks for the feedback. I added a named regression test in 63fc37d that verifies the TypeScript 5.9 declaration emit completes and that getter/setter import type paths are rewritten. I also added an AI-assistance disclosure to the PR description. Validation:
|
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.
Summary
Root cause
TypeScript 5.9 suspends the surrounding lexical environment while visiting a function return type. Calling
visitEachChildfor an accessor nested in that type attempts to start another lexical environment and triggersDebug Failure. False expression: Lexical environment is suspended.This is tracked upstream in microsoft/TypeScript#58020.The transformer now updates bodyless accessors directly while still visiting their type annotations and parameters.
Fixes #437
Validation
yarn fmt:checkyarn lintyarn buildAI assistance disclosure
OpenAI Codex was used to investigate the issue, draft the implementation and regression coverage, and run the validation commands listed above.