From 6bb1ebf031c61d039ca0c3c8d158207f49ef1d11 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 8 Mar 2024 13:04:04 -0500 Subject: Remove spurious promotion between structs --- types.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'types.c') 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; } -- cgit v1.2.3