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

Abstract augmented declaration should not be reported as an error #55566

Open
eernstg opened this issue Apr 25, 2024 · 0 comments
Open

Abstract augmented declaration should not be reported as an error #55566

eernstg opened this issue Apr 25, 2024 · 0 comments
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-feature-macros Implement macros features in the CFE feature-augmentations Implementation of the augmentations feature type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@eernstg
Copy link
Member

eernstg commented Apr 25, 2024

Consider the following program (consisting of two files, one library and one library augmentation, passing --enable-experiment=macros to the tools):

// --- Library augmentation 'augment.dart'.
augment library 'main.dart';

augment class C {
  augment void foo() {}
}

// --- Library 'main.dart'.
import augment 'augment.dart';

class C {
  void foo();
}

This is accepted by the analyzer using dart analyze main.dart but rejected by the common front end with dart main.dart:

main.dart:4:7: Error: The non-abstract class 'C' is missing implementations for these members:
 - C.foo
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class C {
      ^
main.dart:5:8: Context: 'C.foo' is defined here.
  void foo();
       ^^^

I would expect the abstract declaration in 'main.dart' to be accepted because it is transformed into a concrete declaration by the augmentation in augment.dart.

@eernstg eernstg added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-front-end Use area-front-end for front end / CFE / kernel format related issues. feature-augmentations Implementation of the augmentations feature labels Apr 25, 2024
@johnniwinther johnniwinther added the cfe-feature-macros Implement macros features in the CFE label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. cfe-feature-macros Implement macros features in the CFE feature-augmentations Implementation of the augmentations feature type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants