Skip to content

Add fallback error locations for nameless declarations, better class error locations #42585

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

Conversation

weswigham
Copy link
Member

These errors were going unreported because we had no location registered to report them on. Now we allow a non-name fallback location for those declaration emit errors which do not require a name. (And, additionally, set the name location when emitting classes).

Fixes #42499

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Feb 1, 2021
@@ -161,9 +162,9 @@ namespace ts {
}

function reportPrivateInBaseOfClassExpression(propertyName: string) {
if (errorNameNode) {
if (errorNameNode || errorFallbackNode) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd just capture these into a local so you can avoid the !

@weswigham weswigham merged commit 4c43e09 into microsoft:master Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
4 participants