mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
JSDoc typedefs don't actually have hosts, because they're not semantically attached to a declaration. However, the parser still attaches them to some declaration (or statement), but that declaration is not related to the typedef. Previously, delayedBindJSDocTypedefTag used getJSDocHost to walk past the unrelated declaration, but #41858 correctly started categorising typedefs as unattached, with no host, so the binder began falling back to file scope. The path to skip the unrelated declaration is always the same, though, so this PR uses `typeAlias.parent.parent` instead of `getJSDocHost(typeAlias)`.