Implement constructors type checking (?).
This commit is contained in:
@@ -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; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user