Skip to content
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

::new argument field shorthand #2

Closed
Tamschi opened this issue Oct 5, 2020 · 0 comments · Fixed by #8
Closed

::new argument field shorthand #2

Tamschi opened this issue Oct 5, 2020 · 0 comments · Fixed by #8
Labels
accepted This will be worked on type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Comments

@Tamschi
Copy link
Owner

Tamschi commented Oct 5, 2020

Storing constructor arguments in fields is a common pattern in web development even outside of dependency injection. Currently, an argument arg: Type must be reiterated as |arg: Type = {arg}|; to be captured in a field.

An argument specified as priv arg: Type or pub arg: Type should automatically be captured in a field of the same name and type with matching visibility.

The shorthand syntax is a first draft as of now; suggestions are welcome.

@Tamschi Tamschi added type: feature Brand new functionality, features, pages, workflows, endpoints, etc. accepted This will be worked on labels Oct 5, 2020
@Tamschi Tamschi added this to To do in Co-location Oct 5, 2020
@Tamschi Tamschi added this to To do in Boilerplate avoidance Oct 5, 2020
Tamschi added a commit that referenced this issue Oct 9, 2020
@Tamschi Tamschi moved this from To do to Review in progress in Co-location Oct 9, 2020
@Tamschi Tamschi moved this from To do to Review in progress in Boilerplate avoidance Oct 9, 2020
@Tamschi Tamschi closed this as completed in #8 Oct 9, 2020
Co-location automation moved this from Review in progress to Done Oct 9, 2020
Boilerplate avoidance automation moved this from Review in progress to Done Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This will be worked on type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Development

Successfully merging a pull request may close this issue.

1 participant