Open LukeAbby opened 2 months ago
If https://github.com/microsoft/TypeScript/issues/43826 were to be solved this could be perfectly done but I believe at the moment we probably have to be a bit overly conservative to prevent soundness holes.
Fortunately we can tell people to specify required
/nullable
exactly rather than indeterminately if they care.
When
nullable: boolean
users must assume that when gettingnull
is a valid option asnullable
may be true. When setting users must assumenullable
may be false and therefore be an error. This means that indeterminate values fornullable
must be treated differently in different contexts.The same logic applies for
required
.