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

Related error spans for derived members in interfaces/classes #25033

Open
DanielRosenwasser opened this issue Jun 18, 2018 · 0 comments
Open
Labels
Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jun 18, 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 when a derived type incorrectly overrides/implements a member from the base type:

Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.
Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.
Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.
Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.
Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'.

We can actually provide the base type's member as a related span location for some extra context.

'{0}' redefines '{1}' in an incompatible way.

Where

  • 0 is the derived type
  • 1 is the member name

and this gets reported on the base type member.

@DanielRosenwasser DanielRosenwasser added the Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. label Jun 18, 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
@mhegazy mhegazy modified the milestones: TypeScript 3.0, TypeScript 3.1 Jul 2, 2018
@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Experience Enhancement Noncontroversial enhancements Help Wanted You can do this and removed Bug A bug in TypeScript labels Oct 10, 2018
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Experience Enhancement Noncontroversial enhancements Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants