Lint for unspecified type arguments when a type parameter has an upper bound. #57156
Labels
analyzer-linter
Issues with the analyzer's support for the linter package
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
linter-lint-request
type-enhancement
A request for a change that isn't a bug
Or more assertively:
DO: specify a type argument when a type parameter has an upper bound.
As a motivational example take the
dart:math Point
class:The trouble is that this is legal:
Point p = new Point('hello', 'world');
and only fails at runtime if
magnitude
is called:To be sure
Point
is a special case but a general rule might be useful since in general if an upper bound has been defineddynamic
is almost certainly not what's intended.The text was updated successfully, but these errors were encountered: