Closed SirNickolas closed 9 months ago
Now I realize it requires a new template to be added to the public API of results
.
We also need toOption(value)
that forwards to option(value)
. With it added, all tests pass.
Another name is needed because option
from std/options
has two overloads, and one of them does what we try to avoid. I don’t think it is possible to exclude a specific overload (without resorting to a macro that manipulates OpenSymChoice
/ClosedSymChoice
, but that’s clearly an overkill).
Very nice, thank you @SirNickolas!
Accept only optional and reference types as RHS of
=?
.Motivation: I had roughly this code, simplified:
After refactoring, it turned into this:
And… it continued to compile! The else branch suddenly became dead code.
This commit fixes the issue. (The snippet above will produce a compilation error.)
Create identifiers with
genSym
.genSym
, as opposed toident
, introduces a fresh symbol, which cannot leak into user’s scope.