🔎 Search Terms
- silenced Promise resolution type mismatch
- Promise generic explicit no error
- no error when Promise type is specified explicitly
- generic inside optional argument
🕗 Version & Regression Information
TS v3.3.3 correctly detects the error, which is the earliest Playground version. All other Playground versions silence the error.
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=6.0.0-dev.20260312#code/MYewdgzgLgBFCm0BcMAKAnEBbAlheAPNOjmAOYB8MAvGprvgHTqIgA2AbvABQCMAlIygALeGG78A3EA
💻 Code
const test: Promise<string> = Promise.resolve(1).then();
🙁 Actual behavior
No TypeScript errors.
🙂 Expected behavior
I expected a similar error to what TS v3.3.3 yields:
Type Promise<number> is not assignable to type Promise<string>. Type number is not assignable to type string.
Additional information about the issue
No response