Could you please help me to understand why Typescript does not throw an error here:
type Test = Promise<{a: number}>;
const test: Test = Promise.resolve({a: 1, something: 'wrong'}); // no error
but does here
type Test2 = {a: number};
const test2: Test2 = {a: 1, something: 'wrong'}; // error 2322, ok
And is there something I can do to make it throw the similar error with Promise?
Tried it on different versions on Typescript, including the latest one, with strict types.
Tried with new Promise instead of Promise.resolve. Nothing helps.
Take a look on Playground
Thank you in advance!