4 ms·
> The point is you can't simply treat non-nullable as a subtype of nullable in general, because this case exists. But surely, you can still use subtyping in ot
by zarakshR 2y ago
> The point is you can't simply treat non-nullable as a subtype of nullable in general, because this case exists.
But surely, you can still use subtyping in other cases -- when it is already unboxed -- right?
Like so: `T <: T?` for all boxed `T`.
- lmm 2y ago> But surely, you can still use subtyping in other cases -- when it is already unboxed -- right? Well, maybe. But you have to actually have to do the legwork of figuring out which cases are subtypes and which aren't - unboxed was the first case that comes to mind, there might be others. Restating the same thing using symbols doesn't help make anything clearer, it just gets in the way.