From c9072711b509031e0bf2a078fb44a989eb642a80 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Wed, 29 Mar 2023 09:54:15 +0200 Subject: [PATCH] Declaring variables of type works --- core_codegen_c_language.cpp | 1 + examples/push_struct.core | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core_codegen_c_language.cpp b/core_codegen_c_language.cpp index 1a98ce8..1af464d 100644 --- a/core_codegen_c_language.cpp +++ b/core_codegen_c_language.cpp @@ -114,6 +114,7 @@ string_simple_decl_prefix(Ast_Type *ast) { String string = pctx->fmt("Tuple%llu ", ast->type_id); return string; } break; + case TYPE_UNION: case TYPE_STRUCT: { auto constant = (Ast_Decl *)ast->ast; auto name = constant->unique_name; diff --git a/examples/push_struct.core b/examples/push_struct.core index 7ae2ff4..be30931 100644 --- a/examples/push_struct.core +++ b/examples/push_struct.core @@ -21,4 +21,6 @@ main :: (argc: int, argv: **char): int a: *int = PushStruct(&arena, int) Assert(arena.len == SizeOf(int)) + memes: U + return 0 \ No newline at end of file