--
For more ways to connect visit https://dart.dev/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+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/a66623f8-699f-4459-973e-0fed26525d17o%40dartlang.org.
Afaik Never means that the function never returns, e.g. it ends the process or always throws an exception. void means that the function still returns, it just doesn't return a value.
On Sat, Jun 13, 2020, 3:14 PM John <aggi...@gmail.com> wrote:
I noticed in the Changelog a note about the exit function in dart:io having its return type set to Never.--I see no documentation in the API docs for the latest dev release 2.9.0-15.0.dev explaining what the Never type.What's the difference between it and void?
For more ways to connect visit https://dart.dev/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 mi...@dartlang.org.
I think it is intended to provide extra information to the compiler for the optimization purpose. Just like the no return attribute in GCC, the compiler will not link an edge for the statements after this function returns.
Beside the optimization purpose, the compiler is able to emit warning for the statements fall through the function. They will never be able to execute.
------------------------------------------------------------------
发件人:John<aggi...@gmail.com>
日 期:2020年06月15日 07:53:11
收件人:Dart Misc<mi...@dartlang.org>
主 题:Re: [dart-misc] The new Never type
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/465efc7c-410c-496c-b5a9-d044edb31264o%40dartlang.org.
I get the meaning of the word "never" being a return type. But i am asking about documentation for the Never class. Why not change void so it's not returning anything?
On Saturday, June 13, 2020 at 8:00:18 PM UTC-4, re:fi.64 wrote:--Afaik Never means that the function never returns, e.g. it ends the process or always throws an exception. void means that the function still returns, it just doesn't return a value.On Sat, Jun 13, 2020, 3:14 PM John <aggi...@gmail.com> wrote:I noticed in the Changelog a note about the exit function in dart:io having its return type set to Never.--I see no documentation in the API docs for the latest dev release 2.9.0-15.0.dev explaining what the Never type.What's the difference between it and void?
For more ways to connect visit https://dart.dev/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 mi...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/a66623f8-699f-4459-973e-0fed26525d17o%40dartlang.org.
For more ways to connect visit https://dart.dev/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+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/465efc7c-410c-496c-b5a9-d044edb31264o%40dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CACDCfDTkyna95B-WNd53O1CP6ax1U%3DszaJ3S56ochCAk1ngVZg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/465efc7c-410c-496c-b5a9-d044edb31264o%40dartlang.org.