From 2c79bf2d7183f69405bc7f5fbaf4a5fc95c98d8a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 13 Aug 2024 04:31:29 -0400 Subject: Remove reference to Num$hash --- structs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'structs.c') diff --git a/structs.c b/structs.c index bec9d42f..6647320a 100644 --- a/structs.c +++ b/structs.c @@ -144,7 +144,11 @@ void compile_struct_def(env_t *env, ast_t *ast) if (struct_->fields && !struct_->fields->next) { // Single member, can just use its methods type_t *member_t = struct_->fields->type; switch (member_t->tag) { - case TextType: case IntType: case NumType: + case NumType: + typeinfo = CORD_all(typeinfo, ".compare=(void*)", type_to_cord(member_t), "$compare, " + ".equal=(void*)", type_to_cord(member_t), "$equal, "); + goto got_methods; + case TextType: case IntType: typeinfo = CORD_all(typeinfo, ".hash=(void*)", type_to_cord(member_t), "$hash", ", ", ".compare=(void*)", type_to_cord(member_t), "$compare, " ".equal=(void*)", type_to_cord(member_t), "$equal, "); -- cgit v1.2.3