summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-02-19 21:40:41 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-02-19 21:40:41 -0500
commitad08aef58833b35d488dcad40a36cf237a4119c7 (patch)
treecc876d4c38250dbf9272a723a6fb275e652894a6
parent98585d13741499bb370e9c9bedd0d2c390905f21 (diff)
more struct params
-rw-r--r--infer.c1
-rw-r--r--main.c3
-rw-r--r--types.c1
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;
}