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
{{ message }}
Repository navigation
Reference to the function expression identifier in it's body has different symbol #37131
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.
Symbol object identity is not a guaranteed Compiler API contract, including for the function-expression name and its reference after diagnostics have been requested. Use the declarations associated with each symbol when comparing their meanings, or use the language service find-references API for reference queries.
The JavaScript Compiler API from TypeScript 6 and earlier is no longer being developed; it has been superseded by the TypeScript 7 API.
Activity
RyanCavanaugh commentedon Mar 4, 2020
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.RyanCavanaugh commentedon Sep 4, 2026
Symbolobject identity is not a guaranteed Compiler API contract, including for the function-expression name and its reference after diagnostics have been requested. Use the declarations associated with each symbol when comparing their meanings, or use the language service find-references API for reference queries.The JavaScript Compiler API from TypeScript 6 and earlier is no longer being developed; it has been superseded by the TypeScript 7 API.