aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-09-30 17:51:23 +0100
committerGitHub <noreply@github.com>2025-09-30 17:51:23 +0100
commitea7e9bc11cedb7748547fcaf32837286396053ba (patch)
tree48e94558681c43076234619cc99a7db63c04dc3e /src
parent4945168e6db97516e9af65a17aec83e3297f0f90 (diff)
parenta769e341cbb56e1ed018a3581f22c52945f7190a (diff)
Merge pull request #5732 from harold-b/hb.preempt-field-check-sig-similar-enough
Preempt field checking on `signature_parameter_similar_enough` with a type ptr equality check
Diffstat (limited to 'src')
-rw-r--r--src/check_decl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 528ff8abe..b61c23fa7 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -853,12 +853,17 @@ gb_internal bool signature_parameter_similar_enough(Type *x, Type *y) {
Type *x_base = base_type(x);
Type *y_base = base_type(y);
+
+ if (x_base == y_base) {
+ return true;
+ }
+
if (x_base->kind == y_base->kind &&
x_base->kind == Type_Struct) {
- i64 xs = type_size_of(x_base);
+ i64 xs = type_size_of(x_base);
i64 ys = type_size_of(y_base);
- i64 xa = type_align_of(x_base);
+ i64 xa = type_align_of(x_base);
i64 ya = type_align_of(y_base);