summaryrefslogtreecommitdiff
path: root/types.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-02-15 21:00:15 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-02-15 21:00:15 -0500
commitaaf9c614aa1930ccd8df9c08ab9cb9776df4453f (patch)
tree87216eb32e42432824906768220fd85b23321ad6 /types.c
parentfcf3d7a2bef1dfd01e08741623be4f160dda903c (diff)
more struct params
Diffstat (limited to 'types.c')
-rw-r--r--types.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/types.c b/types.c
index 0f89af7..42e32da 100644
--- a/types.c
+++ b/types.c
@@ -598,6 +598,11 @@ static bool type_resolve_(Typer *tr, Type *t, Location where, bool is_reference)
if (!eval_expr(tr->evalr, t->expr, &typeval))
return false;
*t = *typeval.type;
+ if (t->kind == TYPE_STRUCT && !t->struc.args && t->struc.def->params) {
+ err_print(where, "Expected arguments to structure, but you didn't provide any.");
+ info_print(t->struc.def->where, "Structure was declared here.");
+ return false;
+ }
t->was_expr = expr;
assert(t->flags & TYPE_IS_RESOLVED);
} break;