Skip to content

No error in CFE when mixin invokes an abstract super method #47406

@sgrekhov

Description

@sgrekhov

The following code produces an error in Analyzer and no issues in CFE.

abstract class A {
  int get index;
}

mixin M on A {
  int get index => super.index + 1;
}

class AM extends A with M { // Analyzer error here. The class doesn't have a concrete implementation of the super-invoked member 'index'. - mixin_application_no_concrete_super_invoked_member 
  int get index => 42;
}

main() {
  AM am = new AM();
  print(am.index);  // prints 42 in VM
}

cc @eernstg to confirm that analyzer's behavior is right here

Tested on Dart SDK version: 2.15.0-168.0.dev (dev) (Thu Sep 30 12:23:13 2021 -0700) on "windows_x64"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions