Skip to content

Crash when calling a virtual method that is not implemented in the mixin #47148

@axxop

Description

@axxop

main.dart

import 'lib.dart';

mixin D {
  _test();
}

main() {
  P()._test();
}

lib.dart

import 'main.dart';

class P with D {}

The analyzer show no errors, but it crashed in running:

Unhandled exception:
NoSuchMethodError: Class 'P' has no instance method '_test'.
Receiver: Instance of 'P'
Tried calling: _test()
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:63:5)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-as-intendedClosed as the reported issue is expected behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions