Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need a option to treat variable defined by var as typed, not dynamic #20693

Closed
DartBot opened this issue Aug 25, 2014 · 4 comments
Closed

need a option to treat variable defined by var as typed, not dynamic #20693

DartBot opened this issue Aug 25, 2014 · 4 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Milestone

Comments

@DartBot
Copy link

DartBot commented Aug 25, 2014

This issue was originally filed by @rinick


people use "var" to define properties because they don't want to type the whole type name like
/Map<String, List<DivElement>>/ var map = getDivMap();
but in most cases I still want the variable to be typed, not dynamic.

there should be an option to make dartEditor and dart2js use a strict mode to check "var" if it's defined with an assignment.

var str = "hello"; // str is String
str = 123; // warning A value of type 'int' cannot be assigned to a variable of type 'String'
var str2; // this is dynamic
str2 = "hello";
str2 = 123; // no problem

@dgrove
Copy link
Contributor

dgrove commented Aug 27, 2014

Added Area-Analyzer, Triaged labels.

@bwilkerson
Copy link
Member

Set owner to @bwilkerson.
Removed Priority-Unassigned label.
Added Priority-Medium, Duplicate labels.
Marked as being merged into #20443.

@clayberg
Copy link

Added this to the 1.7 milestone.

@DartBot DartBot added Type-Enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-duplicate Closed in favor of an existing report labels Nov 28, 2014
@DartBot DartBot added this to the 1.7 milestone Nov 28, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants