In the main branch, the compiler only checks types when absolutely necessary to compile an expression. Now, we additionally confirm the validity of the expression's type correctness.
There is a lot more to be done:
Confirm that this works for named types, and confirms structurally equality.
Confirm that it works for recursive types.
Add tests to cover the cases detected by the typechecker.
In the
main
branch, the compiler only checks types when absolutely necessary to compile an expression. Now, we additionally confirm the validity of the expression's type correctness.There is a lot more to be done: