-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Allow empty return statements on setters #9370
Comments
Is the issue of the Void annotation, or the return statement I believe it's the former. |
The error is that TypeScript puts an error when there is a return statement on a setter; when it can makes sense to stop the setter becasue of validation or whatever |
The issue is the return type annotation, not the return statement. Expressionless return statements are legal. Return type annotations are not. |
@RyanCavanaugh Ok I'm not really sure what's the difference between the two. Is the |
Yes. The returned value of a setter is unobservable, so it doesn't make any sense to talk about its return type. |
TypeScript Version:
1.8.10
Code
Expected behavior:
No errors.
Actual behavior:
A 'set' accessor cannot have a return type annotation.
.Thanks :)
The text was updated successfully, but these errors were encountered: