diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-08 13:04:04 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-08 13:04:04 -0500 |
| commit | 6bb1ebf031c61d039ca0c3c8d158207f49ef1d11 (patch) | |
| tree | f97bf7df62bf2bf99129feac3468ac719b36f3c7 /types.c | |
| parent | 1677d7a1b901f9bf86b566de64339cefddf3c2bd (diff) | |
Remove spurious promotion between structs
Diffstat (limited to 'types.c')
| -rw-r--r-- | types.c | 18 |
1 files changed, 0 insertions, 18 deletions
@@ -300,24 +300,6 @@ bool can_promote(type_t *actual, type_t *needed) return true; } - if (actual->tag == StructType) { - auto actual_struct = Match(actual, StructType); - auto needed_struct = Match(needed, StructType); - // TODO: allow promoting with uninitialized or extraneous values? - for (arg_t *needed_field = needed_struct->fields, *actual_field = actual_struct->fields; - needed_field || actual_field; - needed_field = needed_field->next, actual_field = actual_field->next) { - - if (!needed_field || !actual_field) - return false; - - // TODO: check field names?? - if (!can_promote(actual_field->type, needed_field->type)) - return false; - } - return true; - } - return false; } |
