From 0ccbba61cea29c0850ee0f4d4b0cb2ebf136172c Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 3 Jan 2025 12:07:54 +0100 Subject: [PATCH] Improve error message. --- src/compiler/sema_decls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/sema_decls.c b/src/compiler/sema_decls.c index dd1269c93..3cd2ea293 100755 --- a/src/compiler/sema_decls.c +++ b/src/compiler/sema_decls.c @@ -3630,7 +3630,8 @@ static bool sema_analyse_macro_method(SemaContext *context, Decl *decl) Decl *first_param = is_constructor ? NULL : decl->func_decl.signature.params[0]; if (!is_constructor && !first_param) { - RETURN_SEMA_ERROR(decl, "The first parameter to this method must be of type '%s'.", type_to_error_string(parent_type)); + RETURN_SEMA_ERROR(decl, "The first parameter to this method must be of type %s or %s.", type_quoted_error_string(parent_type), + type_quoted_error_string(type_get_ptr(parent_type))); } if (!is_constructor && !sema_is_valid_method_param(context, first_param, parent_type, false)) return false;