Skip to content

Use related spans for "implement abstract class" errors #42546

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

Conversation

FlyingPumba
Copy link
Contributor

@FlyingPumba FlyingPumba commented Jan 29, 2021

Hi! This is my first time contributing to Typescript. I picked the smallest issue I could find :)
Please let me know if the solution is acceptable.

Fixes #32848

Example compiling the following code.

abstract class A {
	abstract b(): void;
	abstract c(): void;
}

class B extends A { }

Error message before:

hello.ts:6:7 - error TS2515: Non-abstract class 'B' does not implement inherited abstract member 'b' from class 'A'.

6 class B extends A { }
~

hello.ts:6:7 - error TS2515: Non-abstract class 'B' does not implement inherited abstract member 'c' from class 'A'.

6 class B extends A { }
~

Found 2 errors.

Error message after:

hello.ts:6:7 - error TS18036: Non-abstract class 'B' does not implement all abstract members of 'A'

6 class B extends A { }
~

hello.ts:6:7
6 class B extends A { }
~
Non-abstract class 'B' does not implement inherited abstract member 'b' from class 'A'.
hello.ts:6:7
6 class B extends A { }
~
Non-abstract class 'B' does not implement inherited abstract member 'c' from class 'A'.

Found 1 error.

cc @DanielRosenwasser

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jan 29, 2021
@ghost
Copy link

ghost commented Jan 29, 2021

CLA assistant check
All CLA requirements met.

@FlyingPumba FlyingPumba force-pushed the related-spans-for-implement-abstract-class-error branch from 3555598 to fca0b39 Compare January 29, 2021 15:37
@sandersn sandersn requested review from gabritto and jakebailey and removed request for elibarzilay February 24, 2022 21:31
@sandersn sandersn assigned gabritto and unassigned elibarzilay Feb 24, 2022
@gabritto gabritto merged commit 4b395c6 into microsoft:main Feb 25, 2022
@gabritto
Copy link
Member

gabritto commented Feb 25, 2022

I accidentally merged this while trying to fix the conflicts, sorry. @FlyingPumba can you recreate the PR?

@@ -6346,5 +6346,9 @@
"Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name.": {
"category": "Error",
"code": 18035
},
"Non-abstract class '{0}' does not implement all abstract members of '{1}'": {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the message should be "Non-abstract class '{0}' does not implement all inherited abstract members of '{1}'", to match the old ones

@FlyingPumba
Copy link
Contributor Author

@gabritto ok, no problem! I'll send the PR again with the message change suggested

@FlyingPumba
Copy link
Contributor Author

@gabritto the PR again: #48030 In case this happens again, you can just cherry-pick the old commit on a new branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use related error spans for "implement abstract class" errors
4 participants