diff options
| author | gingerBill <bill@gingerbill.org> | 2022-01-19 15:11:42 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-01-19 15:11:42 +0000 |
| commit | 5ff82fc1132a05d76592e8e21db98913cd498f64 (patch) | |
| tree | e13a0a700e1731b0385cff176ba2c218ea935f25 /src/types.cpp | |
| parent | 28a816ef25476086800a294202aad7c1a1bfc0f0 (diff) | |
Correct tuple name checking for doc writing
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/types.cpp b/src/types.cpp index 6162a5aa8..98dc30703 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -694,7 +694,7 @@ gbString type_to_string (Type *type); i64 type_size_of_internal(Type *t, TypePath *path); void init_map_internal_types(Type *type); Type * bit_set_to_int(Type *t); -bool are_types_identical(Type *x, Type *y); +bool are_types_identical(Type *x, Type *y, bool check_tuple_names/*=false*/); bool is_type_pointer(Type *t); bool is_type_proc(Type *t); @@ -2338,7 +2338,7 @@ Type *strip_type_aliasing(Type *x) { return x; } -bool are_types_identical(Type *x, Type *y) { +bool are_types_identical(Type *x, Type *y, bool check_tuple_names) { if (x == y) { return true; } @@ -2487,6 +2487,11 @@ bool are_types_identical(Type *x, Type *y) { if (xe->kind != ye->kind || !are_types_identical(xe->type, ye->type)) { return false; } + if (check_tuple_names) { + if (xe->token.string != ye->token.string) { + return false; + } + } if (xe->kind == Entity_Constant && !compare_exact_values(Token_CmpEq, xe->Constant.value, ye->Constant.value)) { // NOTE(bill): This is needed for polymorphic procedures return false; |