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

Meta-issue for discussion of the proposal to add voidness-preservation restrictions #30352

Open
leafpetersen opened this issue Aug 7, 2017 · 3 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). language-discussion

Comments

@leafpetersen
Copy link
Member

This issue is to provide a forum for community discussion and feedback related to the proposal to add specified static analysis for restricting the ways in which void producing or consuming objects can be used.

This entry will be updated when a proposal is available.

cc @munificent @eernstg @floitschG @lrhn

@leafpetersen leafpetersen added area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). language-discussion labels Aug 7, 2017
@brianegan
Copy link

brianegan commented Aug 8, 2017

Yay, please add this :) It's awkward to create Stream<Null> onButtonPressed and then onButtonPressed.listen((ignoreMe) => doSomething()).

This can be useful for converting argument-less callbacks into Streams, as an example where I've specifically needed it.

@lrhn
Copy link
Member

lrhn commented Aug 8, 2017

I don't think there is any plan to enable the use of a Function() where a Function(void) is expected.

What you might get is a warning if you use the ignoreMe of voidStream.forEach((ignoreMe) { action(); }); for anything, or if you use do voidStream.forEach(print), which acutally uses the void-typed value.

@natebosch
Copy link
Member

@leafpetersen - was this superseded by generalized void work? Are there remaining potential changes to discuss?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). language-discussion
Projects
None yet
Development

No branches or pull requests

4 participants