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

Add declareVar/Final/Const #363

Merged
merged 2 commits into from
Jun 8, 2022
Merged

Add declareVar/Final/Const #363

merged 2 commits into from
Jun 8, 2022

Conversation

natebosch
Copy link
Member

Closes #343

These utilities serve as a replacement for assignVar/Final/Const which
have an inverted responsibility - the variable is told about it's
assignment, rather than an assignment being told about the variable it
is assigned to. Unifies the interaction with Expression.assign.

Use named instead of positional optional arguments. Add an optional
argument for a late prefix for the final and var declarations. Const
variables may not be late.

Will deprecate the assign* methods in a followup after doing some
cleanup of internal usage.

Closes #343

These utilities serve as a replacement for `assignVar/Final/Const` which
have an inverted responsibility - the variable is told about it's
assignment, rather than an assignment being told about the variable it
is assigned to. Unifies the interaction with `Expression.assign`.

Use named instead of positional optional arguments. Add an optional
argument for a `late` prefix for the final and var declarations. Const
variables may not be `late`.

Will deprecate the `assign*` methods in a followup after doing some
cleanup of internal usage.
@natebosch natebosch requested a review from jakemac53 June 7, 2022 23:17
lib/src/specs/expression.dart Outdated Show resolved Hide resolved
@natebosch natebosch merged commit 63214b2 into master Jun 8, 2022
@natebosch natebosch deleted the declare-var branch June 8, 2022 16:33
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.

Expression.assign is confusing: Either documentation or output is wrong
2 participants