Skip to content

@mustBeOverridden operator -() (unary minus) correctly overridden in the subclass erroneously reports missing_override_of_must_be_overridden #61952

@TekExplorer

Description

@TekExplorer
import 'package:meta/meta.dart';
class Foo {
  @mustBeOverridden
  void operator -() {}
}

class Bar extends Foo { // Missing concrete implementation of '-'.
  @override
  void operator -() {}
}
Image

Inexplicably, this seems to be specific to just unary minus, as far as i can tell.

Additionally, attempting to auto-fix an unimplemented unary minus, it literally fills as:

  @override
  ReturnType operator unary-() {
    // TODO: implement unary-
  }

Which is obviously incorrect, and implies that the issue lies somewhere in how the lint recognizes the name.

Dart SDK version: 3.10.0-75.1.beta (beta) (Thu Aug 7 07:58:56 2025 -0700) on "windows_x64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codeslinter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.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