aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-12 15:56:24 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-12 15:56:24 -0400
commit3481042259c1db4d9fb4e50d5e91e8c58e8cdac5 (patch)
treefa3a470a0ac5cce72bb9380c64495c00fa4da179 /compile.c
parentf6f89265b7eb73bd9a036133033e4fd654196b50 (diff)
Simplify interfaces by requiring all functions are pointer methods
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 7595a6ec..3f25f5f0 100644
--- a/compile.c
+++ b/compile.c
@@ -1662,8 +1662,6 @@ CORD compile(env_t *env, ast_t *ast)
arg_t *type_args = Match(field_t, FunctionType)->args;
CORD args = compile_arguments(env, ast, type_args->next, methodcall->args);
- if (Match(field_t, FunctionType)->args->type->tag != PointerType)
- code_err(ast, "Interface methods that take value types can't be called");
return CORD_all("({ ", compile_type(env, self_value_t), " $self = ",
compile_to_pointer_depth(env, methodcall->self, 0, false), "; ",
"$self.", methodcall->name, "($self.$obj",