Skip to content

fix(50750): Object type literal with string literal property in contextual typing position causes language service error on all literal type references - #50757

Merged
Nathan Shively-Sanders (sandersn) merged 2 commits into
microsoft:mainfrom
a-tarasyuk:fix/50750
Oct 3, 2022

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Fixes #50750

@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 13, 2022
@typescript-bot TypeScript Bot (typescript-bot) added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 13, 2022
Comment thread src/compiler/checker.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd like to find and augment the skip-typed-jsdoc code in services instead of checking for undefined symbols in the checker.

Comment thread src/compiler/checker.ts Outdated
@DanielRosenwasser

Copy link
Copy Markdown
Member

Hm - maybe. What about @link which really does need to semantically refer to the TS declaration?

@sandersn

Nathan Shively-Sanders (sandersn) commented Sep 23, 2022

Copy link
Copy Markdown
Member

This should only apply to type-related jsdoc.

@link refers to values or types, but it's resolved in a services-only code path iirc. I don't think the binder visits it either. Actually, I don't know how (or whether) rename works on @link references in TS or JS.

Edit: Oh, it works because all the services calls to get a symbol go through getSymbolAtLocation, which has the @link/see name resolution code. I suppose that skipping type-related jsdoc references in getSymbolAtLocation might be an OK place if there isn't already code for it somewhere else.

@sandersn
Nathan Shively-Sanders (sandersn) merged commit 7dcf11f into microsoft:main Oct 3, 2022
Comment thread src/services/utilities.ts
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Object type literal with string literal property in contextual typing position causes language service error on all literal type references

5 participants