Skip to content

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

Open
@eernstg

Description

@eernstg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cfe-feature-macrosImplement macros features in the CFEfeature-augmentationsImplementation of the augmentations featurelegacy-area-front-endLegacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions