Skip to content
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

[augmentations] No error in the analyser if merged constructor has multiple super initializers #59631

Open
sgrekhov opened this issue Nov 29, 2024 · 0 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug

Comments

@sgrekhov
Copy link
Contributor

Augmentations spec:

It is a compile-time error if:
...

  • The introductory constructor has a super initializer (super constructor invocation at the end of the initializer list) and the augmenting constructor does too. An augmentation can replace the implicit default super() with a concrete super-invocation, but cannot replace a declared super constructor.

But there's no such error in the analyzer.

class A {
  int x;
  A(this.x);
}

class C extends A {
  C() : super(0); // No expected error here
//^
// [analyzer] unspecified
// [cfe] unspecified
}

augment class C {
  augment C() : super(1);
}

Appropriate co19 test https://github.com/dart-lang/co19/blob/master/LanguageFeatures/Augmentation-libraries/augmenting_constructors_A06_t02.dart.

@sgrekhov sgrekhov added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature labels Nov 29, 2024
@srawlins srawlins added P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. feature-augmentations Implementation of the augmentations feature P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants