aboutsummaryrefslogtreecommitdiff
path: root/structs.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-29 12:55:14 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-29 12:55:14 -0500
commit4b5e4cd1f21582f5e5fa682ab4e4bff252963468 (patch)
treee8fecb01f444c1d392c09255adba5cf6b312b326 /structs.c
parent0b0e0a0a1d41e9574de8dc17c688a4894c5e7f92 (diff)
Change how types handle metamethods
Diffstat (limited to 'structs.c')
-rw-r--r--structs.c3
1 files changed, 2 insertions, 1 deletions
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);