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

Properly display narrowed types when hovering in IDE #8324

Merged
merged 2 commits into from
Apr 27, 2016

Conversation

ahejlsberg
Copy link
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
Copy link
Contributor

mhegazy commented Apr 27, 2016

👍
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