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
This is sort of a bug and sort of not -- in this particular case we (probably?) don't need two different symbols. However, symbol identity is not an invariant of the API contract and you should use different means (e.g. checking declarations) to determine if two instances of the same identifier mean the "same" thing depending on your particular definition of sameness. The TS language service API provides functionality for "find all references" that handles most of this for you depending on your requirements.
TypeScript Version: 3.8.2, 3.9.0-dev.20200229
Search Terms:
Code
Expected behavior:
y
identifier in function name andy
reference in it's body to have the same symbolActual behavior:
They have different symbols.
Few notes:
program.getSemanticDiagnostics()
is not called or a non-diagnostics-producing type checker is used (ref getTypeChecker returns the same checker manufactured for diagnostics … #28584)const content = 'function y() { y }'
works as expectedPlayground Link:
Related Issues:
The text was updated successfully, but these errors were encountered: