Why typescript type inference is behaving like this?

Screenshot 1: Does not work! Screenshot 2: Works!! 😵‍💫
5 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Mir
MirOP3y ago
Yes, it can properly infer when I assign a variable to it.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Mir
MirOP3y ago
GitHub
T implicitly has type 'any' because it does not have a type annotat...
TypeScript Version: 3.7.3 Code type Schema = { [key: string]: Number | String | Boolean | (() => Model<any>) } type Model<T extends Schema> = { } function model&a...
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server