From 0f26f41c326f4dab86cdd1791e08d03d624eeb99 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sat, 30 Nov 2019 23:43:02 -0500 Subject: trying to make this compilable with a c++ compiler maybe it works on some but gccs not happy with my gotos... --- types.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'types.c') diff --git a/types.c b/types.c index 282c930..e0335b4 100644 --- a/types.c +++ b/types.c @@ -198,7 +198,7 @@ static bool type_of_fn(Typer *tr, FnExpr *f, Location where, Type *t, U16 flags) FnExpr fn_copy; if (!(flags & TYPE_OF_FN_NO_COPY_EVEN_IF_CONST) && fn_has_any_const_params(f)) { - Copier cop = {.allocr = tr->allocr, .block = tr->block}; + Copier cop = copier_create(tr->allocr, tr->block); copy_fn_expr(&cop, &fn_copy, f, false); f = &fn_copy; } @@ -1105,7 +1105,7 @@ static bool types_expr(Typer *tr, Expression *e) { /* TODO: evaluate once per decl, not once per ident */ Expression copy; /* make a copy of the default argument, and type and evaluate it. */ - Copier cop = {.block = tr->block, .allocr = tr->allocr}; + Copier cop = copier_create(tr->allocr, tr->block); copy_expr(&cop, ©, ¶m->expr); if (!types_expr(tr, ©)) return false; @@ -1146,7 +1146,7 @@ static bool types_expr(Typer *tr, Expression *e) { /* fn is the instance, original_fn is not */ FnExpr *original_fn = fn; FnExpr fn_copy; - Copier cop = {.allocr = tr->allocr, .block = tr->block}; + Copier cop = copier_create(tr->allocr, tr->block); /* TODO: somehow don't do all of this if we've already generated this instance */ copy_fn_expr(&cop, &fn_copy, fn, true); fn = &fn_copy; -- cgit v1.2.3