dart-lang / linter

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

literal_only_boolean_expressions confused by type arguments #2141

Open Hixie opened 5 years ago

Hixie commented 5 years ago

This, where T is a type argument:

  '$T' == 'Foo'

...results in:

   info • Boolean expression composed only with literals • lib/src/progress.dart:156:5 • literal_only_boolean_expressions
lrhn commented 5 years ago

Seems this info assumes that all literals are constants, which isn't true for interpolations.