This one got more messy than I had hoped for, as the intermediate AST is rewritten from Expr::Var to Expr::EnumDeclaration in the type checker. I struggled a bit finding the right way of handling multiple instances of None (when multiple Option) are in scope, and this is all I could come up with.
I added some assert statements to bind down the return value that is responsible for the Expr::Var -> Expr::EnumDeclaration rewrite. So at least we check at run-time when I couldn't handle at compile-time.
Add support for
Option<T>
types.This one got more messy than I had hoped for, as the intermediate AST is rewritten from) are in scope, and this is all I could come up with.
Expr::Var
toExpr::EnumDeclaration
in the type checker. I struggled a bit finding the right way of handling multiple instances ofNone
(when multiple OptionI added some
assert
statements to bind down the return value that is responsible for theExpr::Var
->Expr::EnumDeclaration
rewrite. So at least we check at run-time when I couldn't handle at compile-time.