[Library] Change signature of dart:io exit to return Never

(see issue - https://github.com/dart-lang/sdk/issues/42006)

Bug:42006
Change-Id: I72b474c6ea398f4e7bd746beac650e625be8857c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148920
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
asiva 2020-05-29 18:45:04 +00:00 committed by commit-bot@chromium.org
parent 02bfe67840
commit 1c6fa369ab
5 changed files with 12 additions and 5 deletions

View file

@ -4,6 +4,13 @@
### Core libraries
#### `dart:io`
* [#42006][]: The signature of `exit` has been changed to return the
`Never`type instead of `void`. since no code will run after it,
[#42006]: https://github.com/dart-lang/sdk/issues/42006
#### `dart:convert`
* **Breaking Change** [#41100][]: When encoding a string containing unpaired

View file

@ -303,7 +303,7 @@ class _Platform {
@patch
class _ProcessUtils {
@patch
static void _exit(int status) {
static Never _exit(int status) {
throw UnsupportedError("ProcessUtils._exit");
}

View file

@ -303,7 +303,7 @@ class _Platform {
@patch
class _ProcessUtils {
@patch
static void _exit(int status) {
static Never _exit(int status) {
throw new UnsupportedError("ProcessUtils._exit");
}

View file

@ -135,7 +135,7 @@ Function _getWatchSignalInternal() => _ProcessUtils._watchSignalInternal;
@patch
class _ProcessUtils {
@patch
static void _exit(int status) native "Process_Exit";
static Never _exit(int status) native "Process_Exit";
@patch
static void _setExitCode(int status) native "Process_SetExitCode";
@patch

View file

@ -7,7 +7,7 @@ part of dart.io;
// TODO(ager): The only reason for this class is that we
// cannot patch a top-level at this point.
class _ProcessUtils {
external static void _exit(int status);
external static Never _exit(int status);
external static void _setExitCode(int status);
external static int _getExitCode();
external static void _sleep(int millis);
@ -49,7 +49,7 @@ class _ProcessUtils {
* program to the surrounding environment. This will avoid any
* cross-platform issues.
*/
void exit(int code) {
Never exit(int code) {
ArgumentError.checkNotNull(code, "code");
if (!_EmbedderConfig._mayExit) {
throw new UnsupportedError(