From 4b5e4cd1f21582f5e5fa682ab4e4bff252963468 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 29 Nov 2024 12:55:14 -0500 Subject: Change how types handle metamethods --- structs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'structs.c') diff --git a/structs.c b/structs.c index 5915f111..da57ff45 100644 --- a/structs.c +++ b/structs.c @@ -27,7 +27,8 @@ void compile_struct_def(env_t *env, ast_t *ast) short_name = strrchr(short_name, '$') + 1; env->code->typeinfos = CORD_all("public const TypeInfo_t ", full_name, ";\n", env->code->typeinfos); - CORD typeinfo = CORD_asprintf("public const TypeInfo_t %r = {.size=%zu, .align=%zu, .tag=StructInfo, .StructInfo.name=\"%s\"%s, " + CORD typeinfo = CORD_asprintf("public const TypeInfo_t %r = {.size=%zu, .align=%zu, .metamethods=Struct$metamethods, " + ".tag=StructInfo, .StructInfo.name=\"%s\"%s, " ".StructInfo.num_fields=%ld", full_name, type_size(t), type_align(t), short_name, def->secret ? ", .StructInfo.is_secret=true" : "", num_fields); -- cgit v1.2.3