Add output and fix two bugs.

This commit is contained in:
2019-08-26 21:05:44 -07:00
parent 7e40af4830
commit 2dd81cf07a
7 changed files with 116 additions and 3 deletions

View File

@@ -34,8 +34,8 @@ void definition_data::typecheck_first(type_mgr& mgr, type_env& env) {
for(auto& constructor : constructors) {
type_ptr full_type = return_type;
for(auto& type_name : constructor->types) {
type_ptr type = type_ptr(new type_base(type_name));
for(auto it = constructor->types.rbegin(); it != constructor->types.rend(); it++) {
type_ptr type = type_ptr(new type_base(*it));
full_type = type_ptr(new type_arr(type, full_type));
}