From 62a72f0163b2f35ca11cd8f4bbb4c7de2c66fca4 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 30 Jul 2017 14:52:42 +0100 Subject: `transmute(type)x`; Minor code clean up --- src/check_decl.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 72ca6d7c4..8b2ab0941 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -319,14 +319,12 @@ bool are_signatures_similar_enough(Type *a_, Type *b_) { if (is_type_integer(x) && is_type_integer(y)) { GB_ASSERT(x->kind == Type_Basic); GB_ASSERT(y->kind == Type_Basic); - if (x->Basic.size == y->Basic.size) { - continue; - } + i64 sx = type_size_of(heap_allocator(), x); + i64 sy = type_size_of(heap_allocator(), y); + if (sx == sy) continue; } - if (!are_types_identical(x, y)) { - return false; - } + if (!are_types_identical(x, y)) return false; } for (isize i = 0; i < a->result_count; i++) { Type *x = base_type(a->results->Tuple.variables[i]->type); @@ -338,9 +336,9 @@ bool are_signatures_similar_enough(Type *a_, Type *b_) { if (is_type_integer(x) && is_type_integer(y)) { GB_ASSERT(x->kind == Type_Basic); GB_ASSERT(y->kind == Type_Basic); - if (x->Basic.size == y->Basic.size) { - continue; - } + i64 sx = type_size_of(heap_allocator(), x); + i64 sy = type_size_of(heap_allocator(), y); + if (sx == sy) continue; } if (!are_types_identical(x, y)) { -- cgit v1.2.3