diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-19 21:40:41 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-02-19 21:40:41 -0500 |
commit | ad08aef58833b35d488dcad40a36cf237a4119c7 (patch) | |
tree | cc876d4c38250dbf9272a723a6fb275e652894a6 | |
parent | 98585d13741499bb370e9c9bedd0d2c390905f21 (diff) |
more struct params
-rw-r--r-- | infer.c | 1 | ||||
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | types.c | 1 |
3 files changed, 3 insertions, 2 deletions
@@ -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) { @@ -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) @@ -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; } |