Implement enhanced support for constant factory constructors #46984
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)
Uh oh!
There was an error while loading. Please reload this page.
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
andfinal
. 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 thelate 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:
The text was updated successfully, but these errors were encountered: