Skip to content

"Test type arguments in operator ==(Object other)" is a very confusing error message #35522

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

Closed
Hixie opened this issue Dec 30, 2018 · 3 comments
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@Hixie
Copy link
Contributor

Hixie commented Dec 30, 2018

This code:

  @override
  bool operator ==(dynamic other) {
    if (other.runtimeType != runtimeType)
      return false;
    final AvatarImage typedOther = other as AvatarImage; // line 465
    return username == typedOther.username
        && photoManager == typedOther.photoManager
        && twitarr == typedOther.twitarr;
  }

Led to this message from the analyzer:

[info] Test type arguments in operator ==(Object other) (/home/ianh/dev/cruisemonkey/lib/src/logic/cruise.dart:465:36)

I have no idea what this means.

@Hixie
Copy link
Contributor Author

Hixie commented Dec 30, 2018

(See http://dart-lang.github.io/linter/lints/test_types_in_equals.html for what it actually means.)

@Hixie
Copy link
Contributor Author

Hixie commented Dec 30, 2018

See also #35523 which is about the lint itself being bad. This specific issue is about the wording of the lint being unclear.

@lrhn lrhn added the legacy-area-analyzer Use area-devexp instead. label Jan 3, 2019
@stereotype441 stereotype441 added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jan 3, 2019
@stereotype441 stereotype441 added the devexp-linter Issues with the analyzer's support for the linter package label Jan 28, 2019
@pq
Copy link
Member

pq commented Jan 28, 2019

This issue was moved to #57892

@pq pq closed this as completed Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants