dart-lang / site-www

Source for Dart website
https://dart.dev
Other
966 stars 695 forks source link

Example shows Future without await #1250

Closed feinstein closed 3 years ago

feinstein commented 5 years ago

There's a sample on the end of the Handling Futures section, showing how to make main async.

That sample starts by calling checkVersion(), which returns a Future, as declared before, but there's no await there.

So for a beginner, the expected behavior isn't obvious.... will it await, because there's an await inside checkVersion()? Or will it just ignore it all, executing a function that returns a Future, and discards that Future?

I think there should be another paragraph explaining what would happen on that particular case.

kwalrath commented 3 years ago

Working on this now.

feinstein commented 3 years ago

Thanks Kathy!

kwalrath commented 3 years ago

Thanks for reporting this, @feinstein!