25 ms·
For what it's worth, this is essentially what Crystal does, though by introducing a union type instead of an optional.
by yxhuvud 4y ago
For what it's worth, this is essentially what Crystal does, though by introducing a union type instead of an optional.
- valenterry 4y agoThis is the way to go.
- duped 4y agoThe only problem is that it can't distinguish between nested if/else blocks at the type level, but it's probably fine