diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 04:31:29 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-13 04:31:29 -0400 |
| commit | 2c79bf2d7183f69405bc7f5fbaf4a5fc95c98d8a (patch) | |
| tree | ecda1e3a597c507420591b25789acb8deb72430d /structs.c | |
| parent | b5f8efdfad87e0c7d49e7a0049cc06e5a4736d5a (diff) | |
Remove reference to Num$hash
Diffstat (limited to 'structs.c')
| -rw-r--r-- | structs.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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, "); |
