Skip to content
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

if a JSSpecialPropertyDeclaration has a JSDoc type, use it #15788

Merged
merged 1 commit into from
May 12, 2017
Merged

Conversation

rbuckton
Copy link
Member

For a JSSpecialPropertyDeclaration (e.g. this.x = y) in a JavaScript file, we currently create a union of the types of all of the locations of the declaration, where each type is either the type from a JSDocTypeTag or the type of the expression. In this change, we treat the JSDocTypeTag in a fashion similar to a type annotation:

  • Always use the type of the first declaration with a JSDocTypeTag (if present).
  • Subsequent declarations with a JSDocTypeTag must have an identical type.
  • If no declaration has a JSDocTypeTag, we follow the existing behavior and create a union of types of the expressions on the right-hand side.

Fixes #15707

@rbuckton rbuckton merged commit a12ec1a into master May 12, 2017
@rbuckton rbuckton deleted the fix15707 branch May 12, 2017 00:10
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants