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

Future.delayed always warns about argument error in the dart editor #19944

Closed
DartBot opened this issue Jul 9, 2014 · 6 comments
Closed

Future.delayed always warns about argument error in the dart editor #19944

DartBot opened this issue Jul 9, 2014 · 6 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Milestone

Comments

@DartBot
Copy link

DartBot commented Jul 9, 2014

This issue was originally filed by esprehn@chromium.org


All the code samples on the dart website have:

new Future.delayed(const Duration(seconds:1), () {
  // ...code goes here...
});

but passing an function that takes no arguments to Future.delayed gives an error in the Dart editor about an argument of type 'path/to/my/app.dart' cannot be passed as an argument of type ''.

@DartBot
Copy link
Author

DartBot commented Jul 9, 2014

This comment was originally written by esprehn@chromium.org


Also my program always crashes with:

Exception: type '() => dynamic' is not a subtype of type '(dynamic) => dynamic' of 'f'. (http://127.0.0.1:8080/fc-app.dart:22)
Breaking on exception: type '() => dynamic' is not a subtype of type '(dynamic) => dynamic' of 'f'.

so I'm not sure how to use Future, it doesn't seem to work at all.

@DartBot
Copy link
Author

DartBot commented Jul 10, 2014

This comment was originally written by @zoechi


I use it like in your above code example all the time and it works fine. Can you please provide the complete code for a working example that causes the errors for you.
What Dart version are you using?

@anders-sandholm
Copy link
Contributor

Added Area-Editor, NeedsInfo labels.

@clayberg
Copy link

Removed Priority-Unassigned, Area-Editor labels.
Added Priority-Medium, Area-Analyzer labels.

@bwilkerson
Copy link
Member

I cannot reproduce the reported behavior, so I'm guessing that the issue was fixed.


Set owner to @bwilkerson.
Added Fixed label.

@clayberg
Copy link

Added this to the 1.8 milestone.

@DartBot DartBot added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 28, 2014
@DartBot DartBot added this to the 1.8 milestone Nov 28, 2014
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.
Projects
None yet
Development

No branches or pull requests

4 participants