-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
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:
class Point<T extends num>
The trouble is that this is legal:
Point p = new Point('hello', 'world');
and only fails at runtime if magnitude is called:
Unhandled exception:
type 'String' is not a subtype of type 'int' of 'times'.
To be sure Point is a special case but a general rule might be useful since in general if an upper bound has been defined dynamic is almost certainly not what's intended.
pohuing
Metadata
Metadata
Assignees
Labels
devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug