aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compile/debuglog.c3
-rw-r--r--src/compile/fieldaccess.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/compile/debuglog.c b/src/compile/debuglog.c
index 498820ee..4128bfa7 100644
--- a/src/compile/debuglog.c
+++ b/src/compile/debuglog.c
@@ -97,6 +97,9 @@ Text_t compile_debug_log(env_t *env, ast_t *ast) {
expr_t = lhs_t;
} else if (expr_t->tag == VoidType || expr_t->tag == AbortType || expr_t->tag == ReturnType) {
value_code = Texts("({", compile_statement(env, value->ast), " NULL;})");
+ } else if (expr_t->tag == FunctionType) {
+ expr_t = Type(ClosureType, expr_t);
+ value_code = Texts("(Closure_t){.fn=", compile(env, value->ast), "}");
} else {
value_code = compile(env, value->ast);
}
diff --git a/src/compile/fieldaccess.c b/src/compile/fieldaccess.c
index 65c8f92b..033851a7 100644
--- a/src/compile/fieldaccess.c
+++ b/src/compile/fieldaccess.c
@@ -19,8 +19,7 @@ Text_t compile_field_access(env_t *env, ast_t *ast) {
if (f->field[0] == '_') {
if (!type_eq(env->current_type, info->type))
code_err(ast, "Fields that start with underscores are not "
- "accessible "
- "on types outside of the type definition.");
+ "accessible on outside of the type definition.");
}
binding_t *b = get_binding(info->env, f->field);
if (!b) code_err(ast, "I couldn't find the field '", f->field, "' on this type");