-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
While it is helpful to unravel futures using async/await, when the non-future item you need is several futures deep, the awaits quickly become hard to read. This comes up a lot in testing/pageloader objects
Example:
expect( await( await (await childElement).description1)).innerText. "blah");
How about introducing an async operator to make this a little cleaner? Something like this:
expect( await childElement->description1->innerText, "blah");
The first await is for the Future returned by inner text. the "->" operator sees that the left side is a future, awaits it, then acts as the access operator. Doesn't have to be "->", but I like the parallel of de-futurizing to pointer dereferencing in c++.
DetachHeadsubzero911rkj, nerder, ivribalko, kennethnym, h3x4d3c1m4l and 8 more
Metadata
Metadata
Assignees
Labels
area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).Dart language related items (some items might be better tracked at github.com/dart-lang/language).type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug