aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 560518df9..9e719756e 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -505,9 +505,13 @@ void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init,
typedef bool TypeCheckSig(Type *t);
bool sig_compare(TypeCheckSig *a, Type *x, Type *y) {
+ x = core_type(x);
+ y = core_type(y);
return (a(x) && a(y));
}
bool sig_compare(TypeCheckSig *a, TypeCheckSig *b, Type *x, Type *y) {
+ x = core_type(x);
+ y = core_type(y);
if (a == b) {
return sig_compare(a, x, y);
}
@@ -542,6 +546,13 @@ bool signature_parameter_similar_enough(Type *x, Type *y) {
return true;
}
+ if (sig_compare(is_type_proc, is_type_proc, x, y)) {
+ return true;
+ }
+ if (sig_compare(is_type_proc, is_type_pointer, x, y)) {
+ return true;
+ }
+
return are_types_identical(x, y);
}