Skip to content

Properly display narrowed types when hovering in IDE#8324

Merged
ahejlsberg merged 2 commits into
masterfrom
fixDisplayOfNarrowedTypes
Apr 27, 2016
Merged

Properly display narrowed types when hovering in IDE#8324
ahejlsberg merged 2 commits into
masterfrom
fixDisplayOfNarrowedTypes

Conversation

@ahejlsberg

Copy link
Copy Markdown
Member

This PR corrects the type information displayed when hovering over variables in the IDE. Specifically, the getTypeOfSymbolAtLocation function used by the language service now consistently returns the narrowed type of a variable unless the variable is the target of an assignment. The PR also removes the old (and shimmed) getNarrowedTypeOfReference function and replaces all usages with calls to the new getFlowTypeOfReference function.

@mhegazy

mhegazy commented Apr 27, 2016

Copy link
Copy Markdown
Contributor

👍
can you also add a test for this, something along the lines of https://github.com/Microsoft/TypeScript/blob/master/tests/cases/fourslash/quickInfoOnGenericClass.ts

@ahejlsberg ahejlsberg merged commit b99a2e0 into master Apr 27, 2016
@mhegazy mhegazy deleted the fixDisplayOfNarrowedTypes branch April 27, 2016 20:20
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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