From ad08aef58833b35d488dcad40a36cf237a4119c7 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 19 Feb 2020 21:40:41 -0500 Subject: more struct params --- infer.c | 1 + main.c | 3 +-- types.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/infer.c b/infer.c index e4c8b98..ff875dc 100644 --- a/infer.c +++ b/infer.c @@ -47,6 +47,7 @@ static bool infer_from_expr(Typer *tr, Expression *match, Expression *to, Expres } } #endif + while (to->kind == EXPR_IDENT) { Identifier i = to->ident; if (i->decl_kind == IDECL_DECL) { diff --git a/main.c b/main.c index 103457b..aaac4f5 100644 --- a/main.c +++ b/main.c @@ -19,9 +19,8 @@ /* TODO: struct parameters -- error on non-const param decls - allow accessing parameters with . -- get rid of inference +- make sure inference works with struct params - should argument set twice error be in call_arg_param_order? --- see infer.c "is resolved_to necessary" (now that ident system has changed) diff --git a/types.c b/types.c index be72a85..4e0b49c 100644 --- a/types.c +++ b/types.c @@ -581,6 +581,7 @@ static bool type_resolve_(Typer *tr, Type *t, Location where, bool is_reference) } } typer_block_exit(tr); + assert(tr->block != &t->struc->scope); t->struc->instance_id = 0; t->struc->flags |= STRUCT_DEF_RESOLVED; } -- cgit v1.2.3