Skip to content

Fixed .flowNode binding on JSDoc nodes #59817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Sep 1, 2024

fixes #58943

quoting my comment there:

JSDoc is bound as a child of its associated declaration and static block declarations are bound as immediately invoked when binding the declaration itself. So this @extends has a flow node pointing to the body of the static block. So when the class' type is requested it tries to resolve the flow node of the super class it received, which leads to resolving the type of the class' in the static block (this bit is circular here).

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Sep 1, 2024
}

function bindJSDoc(node: Node) {
if (hasJSDocNodes(node)) {
if (isInJSFile(node)) {
const saveCurrentFlow = currentFlow;
currentFlow = currentFlowJsDoc;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also considered moving bindJSDoc outside of bindChildren and calling it earlier - before bindContainer and some other function. This seemed like more work and maybe there is a reason why it shouldn't be done - I hope that a reviewer might have some intuition for this 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

JSDoc: property access within static initialization block of @extends annotated class from different file
2 participants