dart-lang / linter

Linter for Dart.
https://dart.dev/tools/linter-rules
BSD 3-Clause "New" or "Revised" License
628 stars 170 forks source link

Linter: `avoid_dynamic_calls` should allow `<any>.runtimeType` #4993

Closed matanlurey closed 1 month ago

matanlurey commented 3 months ago

See https://github.com/flutter/engine/pull/53228#discussion_r1628535479.

This was just an oversight and I want to fix it :)

bwilkerson commented 3 months ago

Given that the lint's documentation reads

There is an exception to methods and properties that exist on Object?:

  • a.hashCode
  • a.runtimeType
  • a.noSuchMethod(someInvocation)
  • a.toString()

It does seem like this is a bug.

srawlins commented 1 month ago

Fixed with https://github.com/dart-lang/sdk/commit/28874ee0ecf0afa192a1fae24c7f2e1a82da7ff0