aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-08 13:04:04 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-08 13:04:04 -0500
commit6bb1ebf031c61d039ca0c3c8d158207f49ef1d11 (patch)
treef97bf7df62bf2bf99129feac3468ac719b36f3c7
parent1677d7a1b901f9bf86b566de64339cefddf3c2bd (diff)
Remove spurious promotion between structs
-rw-r--r--types.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/types.c b/types.c
index 30f648b5..47c0103f 100644
--- a/types.c
+++ b/types.c
@@ -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;
}