You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QuickInfo needs to do the same as well. Assuming you have multiple jsdoc comments for color on both Dog or Cat, the compiler should be smart enough to only pick one or the other based on the discriminant property type.
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: 2.9.1
Issue produced using vscode 1.25.1 which appears to depend on 2.9.1
Search Terms:
tagged union, go to definition
Code
Expected behavior:
Go-to-definition on the
color
property goes to the definition onCat
instead of showing definitions for both Cat and Dog.Actual behavior:
Go-to-definition shows candidate definitions in both the
Cat
andDog
interfaces.Playground Link: https://www.typescriptlang.org/play/#src=type%20Animal%20%3D%20Cat%20%7C%20Dog%3B%0D%0A%0D%0Ainterface%20Cat%20%7B%0D%0A%20%20animaltype%3A%20%22Cat%22%2C%0D%0A%20%20color%3A%20string%2C%0D%0A%20%20friendly%3A%20boolean%3B%0D%0A%7D%0D%0A%0D%0Ainterface%20Dog%20%7B%0D%0A%20%20animaltype%3A%20%22Dog%22%2C%0D%0A%20%20color%3A%20string%2C%0D%0A%20%20likesToFetch%3A%20boolean%3B%0D%0A%7D%0D%0A%0D%0Aconst%20cat%3A%20Animal%20%3D%20%7B%0D%0A%20%20animaltype%3A%20%22Cat%22%2C%0D%0A%20%20color%3A%20%22brown%22%2C%0D%0A%20%20friendly%3A%20true%0D%0A%7D%3B
Related Issues:
The text was updated successfully, but these errors were encountered: