aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compile.c3
-rw-r--r--structs.c1
2 files changed, 1 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index fafbfc06..ea06ce6c 100644
--- a/compile.c
+++ b/compile.c
@@ -1704,8 +1704,7 @@ CORD compile(env_t *env, ast_t *ast)
if (t->tag == StructType) {
// Struct constructor:
fn_t = Type(FunctionType, .args=Match(t, StructType)->fields, .ret=t);
- CORD fn = compile(env, call->fn);
- return CORD_all(fn, "(", compile_arguments(env, ast, Match(fn_t, FunctionType)->args, call->args), ")");
+ return CORD_all("((", compile_type(env, t), "){", compile_arguments(env, ast, Match(fn_t, FunctionType)->args, call->args), "})");
} else if (t->tag == IntType || t->tag == NumType) {
// Int/Num constructor:
if (!call->args || call->args->next)
diff --git a/structs.c b/structs.c
index d62d2df2..57b53550 100644
--- a/structs.c
+++ b/structs.c
@@ -116,7 +116,6 @@ void compile_struct_def(env_t *env, ast_t *ast)
auto def = Match(ast, StructDef);
CORD full_name = CORD_cat(env->file_prefix, def->name);
CORD_appendf(&env->code->typedefs, "typedef struct %r_s %r_t;\n", full_name, full_name);
- CORD_appendf(&env->code->typedefs, "#define %r(...) ((%r_t){__VA_ARGS__})\n", full_name, full_name);
CORD struct_code = CORD_all("struct ", full_name, "_s {\n");
for (arg_ast_t *field = def->fields; field; field = field->next) {