dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.23k stars 1.57k forks source link

Flutter customer tests override operator == with a dynamic parameter. #51038

Closed srawlins closed 1 year ago

srawlins commented 1 year ago

See failures here: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8791703831221213185/+/u/Customer_testing/customer_testing/test_stdout

We have to fix all of these before issuing a warning about it.

navaronbracke commented 1 year ago

@srawlins If I'm not mistaken you should be using other is SomeType && <other checks here> instead of as?

Yes, you will get a warning from the unrelated_type_equality_checks lint but it fails at runtime with a type cast error.

srawlins commented 1 year ago

I'm not sure what you're referring to. One of the PRs? Could you comment on the PR?

navaronbracke commented 1 year ago

@srawlins I commented on https://github.com/PhilipsHue/flutter_reactive_ble/pull/677 to clarify.

Not sure about the cast in the flutter_cocoon PR, but per https://github.com/flutter/cocoon/pull/2400#discussion_r1072962994 I think its fine?

srawlins commented 1 year ago

Customer tests are fixed.