-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-augmentationsImplementation of the augmentations featureImplementation of the augmentations feature
Description
class C {
C();
factory C.foo() = C;
}
augment class C {
augment C();
augment factory C.foo(); // Errors, see below
}
main() {
print(C);
}Analyzer (with --enable-experiment=macros) produces two errors here.
error • augmenting_constructors_A03_t04.dart:54:19 • The constructor with name 'foo' is already defined. Try renaming one of the constructors. • duplicate_constructor
error • augmenting_constructors_A03_t04.dart:54:26 • A function body must be provided. Try adding a function body. • missing_function_body
If to update the test and to remove the factory keyword from the augmentation then the error disappears.
class C {
C();
factory C.foo() = C;
}
augment class C {
augment C();
augment C.foo(); // Ok, no error
}Dart SDK version: 3.7.0-86.0.dev (dev) (Wed Oct 30 17:03:22 2024 -0700) on "windows_x64"
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-augmentationsImplementation of the augmentations featureImplementation of the augmentations feature