Reputation: 13
Should't this throw a compiler error?
type Test<T extends number | string> = { v: T extends number ? true : false }
const test: Test<1> = { v: undefined }
Am I missing something?
Thanks
Upvotes: 1
Views: 22
Reputation: 25790
It does if you have the strictNullChecks
flag enabled in your tsconfig.json
.
Upvotes: 2