Skip to content

Adjust nnbd spec to allow a const factory in a class with a late final variable #1764

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
merged 4 commits into from
Aug 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions accepted/2.12/nnbd/feature-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Status: Draft

## CHANGELOG

2021.07.28
- Allow a constant factory constructor in a class with a late final instance
variable.

2020.12.30
- Remove the warning for overrides with different default values.
- Specify canonicalization of type literals.
Expand Down Expand Up @@ -604,8 +608,8 @@ It is an error for the initializer expression of a `late` local variable to use
a prefix `await` expression that is not nested inside of another function
expression.

It is an error for a class with a `const` constructor to have a `late final`
instance variable.
It is an error for a class with a generative `const` constructor to have a
`late final` instance variable.

It is not a compile time error to write to a `final` non-local or instance
variable if that variable is declared `late` and does not have an initializer.
Expand Down