mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-17 11:22:22 -07:00
Fix type aliasing comparison; Fix gb_utf8_decode
This commit is contained in:
@@ -1157,6 +1157,19 @@ bool is_type_comparable(Type *t) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Type *strip_type_aliasing(Type *x) {
|
||||
if (x == nullptr) {
|
||||
return x;
|
||||
}
|
||||
if (x->kind == Type_Named) {
|
||||
Entity *e = x->Named.type_name;
|
||||
if (e != nullptr && e->kind == Entity_TypeName && e->TypeName.is_type_alias) {
|
||||
return x->Named.base;
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
bool are_types_identical(Type *x, Type *y) {
|
||||
if (x == y) {
|
||||
return true;
|
||||
@@ -1167,6 +1180,9 @@ bool are_types_identical(Type *x, Type *y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
x = strip_type_aliasing(x);
|
||||
y = strip_type_aliasing(y);
|
||||
|
||||
switch (x->kind) {
|
||||
case Type_Generic:
|
||||
if (y->kind == Type_Generic) {
|
||||
|
||||
Reference in New Issue
Block a user