Implement constructors type checking (?).

This commit is contained in:
2019-06-09 21:25:02 -07:00
parent 0b80ce711d
commit d729611486
7 changed files with 74 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ namespace lily {
struct type {
virtual ~type() = default;
virtual bool unify_with(type* other) = 0;
virtual int arity() { return 0; }
};
struct type_internal : type {
@@ -49,6 +50,7 @@ namespace lily {
type_func(type* l, type* r) :
left(l), right(r) {}
bool unify_with(type* other);
int arity() { return right->arity() + 1; }
};
}