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

Add related error spans for use-before-declaration #25003

Closed
DanielRosenwasser opened this issue Jun 15, 2018 · 0 comments
Closed

Add related error spans for use-before-declaration #25003

DanielRosenwasser opened this issue Jun 15, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Fixed A PR has been merged for this issue

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jun 15, 2018

Now that we support multiple related spans for errors (#10489, #22789, #24548), we'd like to improve an existing error message.

Currently, we provide certain errors for using certain declarations before they're actually declared:

Block-scoped variable '{0}' used before its declaration.
Class '{0}' used before its declaration.
Enum '{0}' used before its declaration.

We can actually provide the definition location as a related span for some extra context.

'{0}' was accessed prior to being declared here.
@DanielRosenwasser DanielRosenwasser added the Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. label Jun 15, 2018
@mhegazy mhegazy added the Bug A bug in TypeScript label Jun 19, 2018
@mhegazy mhegazy added this to the TypeScript 3.0 milestone Jun 19, 2018
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants