Discussion:
[dart-misc] Void issues in dev.69.1
mfairhurst via Dart Misc
2018-07-20 23:37:24 UTC
Permalink
TLDR: The versions of dart2js and dart in dev-69.1 issue some incorrect
errors around void. These should be fixed in dev-69.2.

In the latest dev build (dart 2.0.0-dev.69.1), void usage errors are now
enforced reported before running your dart programs:

void f() {}
print(f()); // error, you can't use the result of f()!

These have been reported in the analyzer for a few months now, and we
believe this will catch bugs in your code and is a good change.

Unfortunately there were some bugs in the new voidness checks that are
stricter than we had originally decided to do. Here are some examples:

Future f() async => voidFn(); // Inadvent error
when(voidFn()).thenReturn(...); // Inadvertent error
run(() { return voidFn(); }); // Inadvertent error

And some of these issues affect the package ecosystem:

package:analyzer must be upgraded to 0.32.4
package:coveralls is currently not in a workable state

This change has been rolled back and will be fixed in dev-69.2, which
should be released shortly. In the meantime you can use dev.69.0, or you
can, if you wish, fix your code to comply with the extra strict errors.
However be aware that these will not be required after the next release.

There is one new error which you may newly see which is likely to be kept
for dart 2, which you may also see. This was not reported before due to a
bug:

void f() async {} // an async function that you should not await
await f(); // this is now reported as an error

If you have issues with this in your package, please let us know.

We recognize that the current state of void errors is a bit confusing with
this release, compared to old ones, and trying to predict what that means
going forward. Please reach out to me if you have any questions!
***@google.com
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/cd204503-d256-485e-b50c-222f626fab49%40dartlang.org.
Patrice Chalin
2018-07-24 10:34:22 UTC
Permalink
Post by mfairhurst via Dart Misc
TLDR: The versions of dart2js and dart in dev-69.1 issue some incorrect
errors around void. These should be fixed in dev-69.2.
Hi Mike: you wrote "should be fixed in dev-69.2". Can you confirm whether
the fix made it into dev-69.2? Thanks, Patrice

In the latest dev build (dart 2.0.0-dev.69.1), void usage errors are now
Post by mfairhurst via Dart Misc
void f() {}
print(f()); // error, you can't use the result of f()!
These have been reported in the analyzer for a few months now, and we
believe this will catch bugs in your code and is a good change.
Unfortunately there were some bugs in the new voidness checks that are
Future f() async => voidFn(); // Inadvent error
when(voidFn()).thenReturn(...); // Inadvertent error
run(() { return voidFn(); }); // Inadvertent error
package:analyzer must be upgraded to 0.32.4
package:coveralls is currently not in a workable state
This change has been rolled back and will be fixed in dev-69.2, which
should be released shortly. In the meantime you can use dev.69.0, or you
can, if you wish, fix your code to comply with the extra strict errors.
However be aware that these will not be required after the next release.
There is one new error which you may newly see which is likely to be kept
for dart 2, which you may also see. This was not reported before due to a
void f() async {} // an async function that you should not await
await f(); // this is now reported as an error
If you have issues with this in your package, please let us know.
...
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/98de49fe-c39c-4df1-96a9-83b207c3c4f9%40dartlang.org.
'William Hesse' via Dart Misc
2018-07-24 13:22:23 UTC
Permalink
The fixes for this did make it into dev-69.2.
I have not verified them in that version.
Post by mfairhurst via Dart Misc
TLDR: The versions of dart2js and dart in dev-69.1 issue some incorrect
errors around void. These should be fixed in dev-69.2.
In the latest dev build (dart 2.0.0-dev.69.1), void usage errors are now
void f() {}
print(f()); // error, you can't use the result of f()!
These have been reported in the analyzer for a few months now, and we
believe this will catch bugs in your code and is a good change.
Unfortunately there were some bugs in the new voidness checks that are
Future f() async => voidFn(); // Inadvent error
when(voidFn()).thenReturn(...); // Inadvertent error
run(() { return voidFn(); }); // Inadvertent error
package:analyzer must be upgraded to 0.32.4
package:coveralls is currently not in a workable state
This change has been rolled back and will be fixed in dev-69.2, which
should be released shortly. In the meantime you can use dev.69.0, or you
can, if you wish, fix your code to comply with the extra strict errors.
However be aware that these will not be required after the next release.
There is one new error which you may newly see which is likely to be kept
for dart 2, which you may also see. This was not reported before due to a
void f() async {} // an async function that you should not await
await f(); // this is now reported as an error
If you have issues with this in your package, please let us know.
We recognize that the current state of void errors is a bit confusing with
this release, compared to old ones, and trying to predict what that means
going forward. Please reach out to me if you have any questions!
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/e6292f07-62a8-43e1-9976-c20e9c922781%40dartlang.org.
Loading...