Skip to content

Limit error reporting for methods to the method name #5972

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

Merged
merged 2 commits into from
Dec 10, 2015

Conversation

reavowed
Copy link

@reavowed reavowed commented Dec 7, 2015

Fixes #5732

@msftclas
Copy link

msftclas commented Dec 7, 2015

Hi @reavowed, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, MSBOT;

@@ -11175,7 +11175,7 @@ namespace ts {
// Abstract methods cannot have an implementation.
// Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node.
if (node.flags & NodeFlags.Abstract && node.body) {
error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
error(node.body, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is not much better than just node, the body could be a whole file. with the other change, the new range will be just the name, which is a better fit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just keep it as node

@mhegazy
Copy link
Contributor

mhegazy commented Dec 7, 2015

thanks @reavowed, i have one comment, other than that looks good to me.

DanielRosenwasser added a commit that referenced this pull request Dec 10, 2015
Limit error reporting for methods to the method name
@DanielRosenwasser DanielRosenwasser merged commit 6e06752 into microsoft:master Dec 10, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants