Closed osa1 closed 1 month ago
Almost there.. we need to implement default trait methods so that __gt
etc. will work when you only implement cmp
.
I think we just need to check that the predicates hold after checking functions and that should be it! (for now)
This implements type checking in the interpreter.
The type system is simple:
All type variables have kind
*
.All function declarations have full type signatures.
No elaboration is necessary: method calls are implemented via (type, method) lookups.
Traits have only one type parameter.
We also don't implement row polymorphism for anonymous types in the interpreter.
The result is a very simple type checker that checks each function in isolation.