-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fix mixing access modifiers (e.g. readonly
) with @
arguments in constructors
#1631
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to handle the TS output slightly differently since it looks like TS also inserts the assignment: https://www.typescriptlang.org/play/?#code/MYGwhgzhAEBiD29oG8CwAoa1jwHYQBcAnAV2APiIAoiBTMAEzxAE9oAjMIgSmQIAsAlhAB0nItAC8HLgG4AvhnlA
I agree that it's redundant, but at least the double assignment is not incorrect... I could imagine the current behavior of this PR being somewhat helpful in some scenarios:
Probably better would be for Civet to support |
Actually, it looks like we already did this, some time ago. Here's a fun situation: class Foo
@(public @var) Currently we compile this to: class Foo {
constructor(public _var){this.var = _var;}
} This declares the wrong thing class Foo {
public var
constructor(_var){this.var = _var;}
} So I'm tempted to lift |
OK, there shouldn't be any duplicate |
readonly
with @
arguments in contructorsreadonly
) with @
arguments in constructors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Fixes #1601