kevinbarabash / compiler

2 stars 0 forks source link

Impove subtyping #41

Closed kevinbarabash closed 2 years ago

kevinbarabash commented 2 years ago

Relying on setting .src to "App" or "Lam" was insufficient to correctly enforce sub-typing because subtype constraints could occur on deeply nested types far away from a function call. This updates the Constraint type to be an object that contains the .types being constrained as well as the direction ("Left" or "Right") of the .subtype constraint if there is on. This allow any subtype constraints to be fully propagated throughout the system.

TODO: