DenoDDeno
Powered by
abiA
Denoβ€’2y agoβ€’
26 replies
abi

Type-narrowing/covariance/contravariance

Why is it that
5
5
has type
5
5
but
{five:5}
{five:5}
has type
{five:number}
{five:number}
and not
{five:5}
{five:5}
?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Simple type narrowing/type guard/assertion (?)
abiAabi / help
3y ago
Deno KV Type narrowing issue
whaleyWwhaley / help
7mo ago
Deno LSP not narrowing types
BreadBBread / help
9mo ago
Type alias with inherited type parameter constraints
abiAabi / help
3y ago