Skip to content

Commit 8e6a934

Browse files
vladimir-tikhonovdcodeIO
authored andcommitted
Make TypeScript recognize 'unreachable()' as an end point (AssemblyScript#1011)
1 parent 7acff76 commit 8e6a934

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

NOTICE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ under the licensing terms detailed in LICENSE:
2020
* Jay Phelps <hello@jayphelps.com>
2121
* jhwgh1968 <jhwgh1968@protonmail.com>
2222
* Jeffrey Charles <jeffreycharles@gmail.com>
23+
* Vladimir Tikhonov <reg@tikhonov.by>
2324

2425
Portions of this software are derived from third-party works licensed under
2526
the following terms:

std/assembly/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ declare function trunc<T = f32 | f64>(value: T): T;
107107
declare function load<T>(ptr: usize, immOffset?: usize, immAlign?: usize): T;
108108
/** Stores a value of the specified type to memory. Equivalent to dereferencing a pointer in other languages when assigning a value. */
109109
declare function store<T>(ptr: usize, value: any, immOffset?: usize, immAlign?: usize): void;
110-
/** Emits an unreachable operation that results in a runtime error when executed. Both a statement and an expression of any type. */
111-
declare function unreachable(): any; // sic
110+
/** Emits an unreachable operation that results in a runtime error when executed. Both a statement and an expression. */
111+
declare function unreachable(): never;
112112

113113
/** NaN (not a number) as a 32-bit or 64-bit float depending on context. */
114114
declare const NaN: f32 | f64;

0 commit comments

Comments
 (0)