Skip to content

[analyzer] No error if augmentation adds instance/static methods conflict #55452

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

Open
sgrekhov opened this issue Apr 12, 2024 · 1 comment
Open
Labels
area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. feature-macros Implementation of the macros feature P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@sgrekhov
Copy link
Contributor

The following code produces no errors in the analyzer

import augment 'aug_lib.dart';

class C {
  static int foo() => 42;
}

mixin M {
  static int get foo => 42;
}

main() {
  print(C);
  print(M);
}
// aug_lib.dart

augment library 'main_lib.dart';

augment class C {
  int foo() => 42; // Must be an error, there is static method 'foo'
}

augment mixin M {
  int foo() => 42; // Muxt be an error, there is static method 'foo'
}
@sgrekhov sgrekhov added legacy-area-analyzer Use area-devexp instead. feature-macros Implementation of the macros feature labels Apr 12, 2024
@scheglov scheglov added the P2 A bug or feature request we're likely to work on label Apr 12, 2024
@srawlins srawlins added the type-enhancement A request for a change that isn't a bug label Apr 26, 2024
@lrhn
Copy link
Member

lrhn commented Apr 27, 2024

(That's awesome, let's just allow it! dart-lang/language#1711 FTW.)

Alas, until we get that feature, it should be an error.

@johnniwinther johnniwinther added area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. and removed legacy-area-analyzer Use area-devexp instead. labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. feature-macros Implementation of the macros feature P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
Development

No branches or pull requests

5 participants