Augmentation libraries: Conflict between super
constructor and "The augmentation has an 'extends' clause, but an augmentation target already includes an 'extends' clause" and
#56224
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
feature-augmentations
Implementation of the augmentations feature
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Hello!
Consider a macro applied on the following class:
The macro may want to augment that class with a constructor that uses
super.field
:The issue is twofold:
Augmentations cannot generate an
extends
if one is present:This will produce
The augmentation has an 'extends' clause, but an augmentation target already includes an 'extends' clause
If no extends is specified on the augmentation, then the analyzer seems to fail to find the
super.namedConstructor
and treatsuper.field
as missing. So the following:Will fail with
No associated positional super constructor parameter. Try using a normal parameter, or adding more positional parameters to the super
I assume the problem is that
super.someNamedConstructor();
should be able to resolve, by looking at the class definition.The text was updated successfully, but these errors were encountered: