Skip to content

Commit f8ee665

Browse files
committed
fix(type): enhance type equality check by stripping typedefs
Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
1 parent d6c94c6 commit f8ee665

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/symbol_table/type.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ bool is_void_type(TypePtr type)
116116

117117
bool are_types_equal(TypePtr a, TypePtr b)
118118
{
119-
return a->mangled_name() == b->mangled_name();
119+
auto a_canonical = strip_typedefs(a);
120+
auto b_canonical = strip_typedefs(b);
121+
return a_canonical->mangled_name() == b_canonical->mangled_name();
120122
}
121123

122124
bool is_integral_or_enum_non_bool(TypePtr type)

0 commit comments

Comments
 (0)