Skip to content

Implement enhanced support for constant factory constructors #46984

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

Closed
7 tasks done
eernstg opened this issue Aug 24, 2021 · 0 comments
Closed
7 tasks done

Implement enhanced support for constant factory constructors #46984

eernstg opened this issue Aug 24, 2021 · 0 comments
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). implementation Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)

Comments

@eernstg
Copy link
Member

eernstg commented Aug 24, 2021

Cf. the specification change in dart-lang/language#1764, based on the discussions in dart-lang/language#1763 and #46758:

It is no longer an error to have a constant factory constructor (which is then necessarily redirecting1) in a class that has an instance variable which is late and final. Note that the constraints on classes derived from the existence of a constant constructor only apply in the case where that constructor is non-redirecting and generative, and hence the late final instance variable is just one of the members that a class can have, in the case where every constant constructor in the class is a factory (so we're never going to have a "constant object" which is an instance of that class, we're just using its interface).

This issue is concerned with the implementation of this feature. This change should be applied regardless of language version, since it brings the analyzer in line with pre-existing CFE behavior.

Subtasks:

Footnote 1: The system classes contain some external constant factory constructors. This is not a language feature, and hence we will ignore them here.

Edits:

  • Aug 26: The change is no longer part of the constructor-tearoffs feature; adjusted the text above accordingly.
@eernstg eernstg added area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). implementation Track the implementation of a specific feature (use on area-meta issue, not issues for each tool) labels Aug 24, 2021
dart-bot pushed a commit that referenced this issue Aug 26, 2021
Change-Id: I750345600d3b47de44c060511be35aea8744eca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211140
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
@eernstg eernstg closed this as completed Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). implementation Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)
Projects
None yet
Development

No branches or pull requests

1 participant