4 ms·
https://www.typescriptlang.org/docs/handbook/type-compatibility.html#a-note-on-soundness https://www.typescriptlang.org/docs/handbook/type-compatibil... https:
by shepherdjerred 2y ago
https://www.typescriptlang.org/docs/handbook/type-compatibility.html#a-note-on-soundness https://www.typescriptlang.org/docs/handbook/type-compatibil...
https://www.typescriptlang.org/play/?strictFunctionTypes=false#example/soundness https://www.typescriptlang.org/play/?strictFunctionTypes=fal...
- yencabulator 2y ago// This can go all the way back to the smallest common type: listenForEvent("mouse", (event: {}) => { }); Typescript {} is a trap that means "any container of things is fine" (including objects), it's not the empty struct. One of the very ugly oddities of the language.. `Record<string, never>` or something like that is the closest equivalent to an empty struct. https://github.com/typescript-eslint/typescript-eslint/issues/2063 https://github.com/typescript-eslint/typescript-eslint/issue...