adam-mcdaniel / sage

A programming language that's wise beyond its bytes!🌱🌿🪴
https://adam-mcdaniel.net/sage-website
MIT License
437 stars 15 forks source link

WIP: Type checking #3

Closed adam-mcdaniel closed 2 years ago

adam-mcdaniel commented 2 years ago

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:

  1. Confirm that this works for named types, and confirms structurally equality.
  2. Confirm that it works for recursive types.
  3. Add tests to cover the cases detected by the typechecker.