aboutsummaryrefslogtreecommitdiff
path: root/interfaces.c
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces.c')
-rw-r--r--interfaces.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/interfaces.c b/interfaces.c
index a1f1e73f..db587cba 100644
--- a/interfaces.c
+++ b/interfaces.c
@@ -69,6 +69,8 @@ void compile_interface_def(env_t *env, ast_t *ast)
type_t *field_t = parse_type_ast(env, field_type);
if (field_t->tag == ClosureType)
field_t = Match(field_t, ClosureType)->fn;
+ if (field_t->tag != FunctionType)
+ field_t = Type(PointerType, .pointed=field_t);
CORD decl = compile_declaration(env, field_t, field->name);
CORD_appendf(&env->code->typecode, "%r%s;\n", decl,
field_t->tag == BoolType ? ":1" : "");