Skip to content

Add error message for set accessor visibility issues #33683

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

This fixes the crash in RWC.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Code looks good but it would be nice to have tests for all 3 new errors.

==== tests/cases/compiler/accessorDeclarationEmitVisibilityErrors.ts (2 errors) ====
export class Q {
set bet(arg: DoesNotExist) {}
~~~~~~~~~~~~
Copy link
Member

Choose a reason for hiding this comment

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

names that don't exist create a "is using private name" errors? ok..

Copy link
Member Author

Choose a reason for hiding this comment

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

Eeeeyup.

@weswigham
Copy link
Member Author

Code looks good but it would be nice to have tests for all 3 new errors.

Yeah, unfortunately, the other two are there to cover the space of errors allowed by the type declarations for accessibility errors, but I don't think they're possible to ever trigger as, at least right now, a setter cannot have inferred types. We have a lot of declaration emit errors like that, though (since we started serializing non-exported declarations if they're referenced by exported ones), so that's not so bad.

@weswigham weswigham merged commit 98cf317 into microsoft:master Sep 30, 2019
@weswigham weswigham deleted the accessor-declaration-emit-crash branch September 30, 2019 20:12
@weswigham
Copy link
Member Author

And now to wait for the next rwc diff on master, which'll include a ton of set/get declarations ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants