-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
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).language-discussion
Description
Instead of
Future<void>().then((_) { ... });
Completer<void>().complete(null);
Stream.listen((_) { ... });
new StreamController().add(null);
Could we make it possible to write just
Future<void>().then(() { ... });
Completer<void>().complete();
Stream.listen(() { ... });
new StreamController().add();
?
Some tendrils I can think of here:
- Does this mean void Function(void) is a subtype of void Function() ? (thought: no, because its not ABI compatible)
- If not, how can () -> R be assignable to (T) -> R in Future.then?
- If
() {}
is inferred as(void) -> R
, is there a way to write this explicitly? Is(void _) {}
close enough? - won't handle Function(..., void, ..., T)
- cardinality of functions becomes no longer a single answer (Function(void, void, void) would have four different cardinalities -- everything from 0 to 3)
- adding a new way of doing the same thing is not as good as having one excellent method. But I don't think this could replace the alternative
segfaultmedaddy, HerrNiklasRaab, ride4sun, vaind, webnickell and 4 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).language-discussion