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

DartEdit failed to warn the use of a non-existent method from Future<Type> #14983

Closed
DartBot opened this issue Nov 9, 2013 · 6 comments
Closed
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Nov 9, 2013

This issue was originally filed by @tomyeh


The following is the same code. Dart Edit shall show a warning or error to indicate String has no method called m, but it doesn't. I remember it was OK in previous version. Sure, we can declare the closure as (String s) {...}. However, it is more convenient if Dart Editor can help.

Dart version: 0.8.10.6_r30036


Future<String> f() {}

Future g()
=> f().then((s) {
  s.m = "a";
});

@bwilkerson
Copy link
Member

Added this to the Later milestone.
Removed Type-Defect, Priority-Unassigned labels.
Added Type-Enhancement, Priority-Medium, Area-Analyzer, Triaged labels.

@lrhn
Copy link
Member

lrhn commented Nov 11, 2013

It can't be a warning or error. It can at most be a hint.
The spec requires not warning here, because "s" has type dynamic.
Only a more intelligent type propagation can infer that its value will likely have type String when run.

@DartBot
Copy link
Author

DartBot commented Nov 11, 2013

This comment was originally written by @tomyeh


Agree, but it means we have to specify every argument type clearly to enjoy the strong type checking. The same applies to the use of var/final too. It seems there is no better alternative:(

@bwilkerson
Copy link
Member

Added Analyzer-Hint label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@DartBot DartBot added Type-Enhancement area-analyzer analyzer-warning Issues with the analyzer's Warning codes labels Aug 4, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@lrhn lrhn added the closed-obsolete Closed as the reported issue is no longer relevant label May 9, 2023
@lrhn lrhn closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants