-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
π Search Terms
Debug Failure. Expected -1 >= 0
assertDiagnosticLocation
checkSourceElementUnreachable
compiler crash nightly
π Version & Regression Information
Observed in: TypeScript Nightly
Does not occur in: 5.7.3, 5.8.3, 5.9.3
β― Playground Link
π» Code
export async function arrayFromAsync<T>(asyncIterable!: AsyncIterable<T>): Promise<T[]> {
const out = [];
for await (const v of asyncIterable) {
out.push(await v);
}
return out;
}π Actual behavior
.\ts-versions\nightly\node_modules.bin\tsc.cmd --ignoreConfig .\test-async-array.ts
D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:123191
throw e;
^
Error: Debug Failure. Expected -2 >= 0
at assertDiagnosticLocation (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:13878:9)
at createFileDiagnostic (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:17717:3)
at checkSourceElementUnreachable (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:86649:74)
at checkSourceElementWorker (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:86427:11)
at checkSourceElement (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:86396:7)
at forEach (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:32:22)
at checkSourceFileWorker (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:86866:7)
at checkSourceFile (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:86825:69)
at checkSourceFileWithEagerDiagnostics (D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:86952:5)
at D:\do\tscFuzz\ts-versions\nightly\node_modules\typescript\lib_tsc.js:86974:46
Node.js v22.19.0
π Expected behavior
The compiler should emit standard syntax errors (e.g., TS1005: ',' expected) and terminate gracefully without a "Debug Failure" crash, as it does in version 5.9.3.
Additional information about the issue
No response