Skip to content

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

Closed
@DanielRosenwasser

Description

@DanielRosenwasser

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.

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: Related Error SpansSpecifying regions for error messages/diagnostics on multiple locations.FixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions