- Sound mode S-10, pre-alpha
- Design record 0007, Accepted
TSR1002
'void' discards a promise that can reject. Attach '.catch' first: 'void {0}.catch(...)'.
'void' discards a promise that can still reject. Attach a handler first: void p.catch(...).
Rule S-10: No floating promises (level: strict). Reported by ts-r-check and ts-r-lsp in files that opt in to sound mode. See Sound mode.
What it means
void p hides a promise from the type checker but not its rejection. In sound and strict files void is allowed only on a handled chain.
Example
// void hides the promise but not its rejection.
async function save(x: string): Promise<void> {
console.log(x);
}
void save("a"); // @expect TSR1002
export {};
How to fix
- Handle the rejection before discarding:
void save(user).catch(report). - Or
awaitthe promise.
Sound mode is defined in design record 0007 (accepted 2026-10-15).