mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Differentiate errors on generic mismatch.
This commit is contained in:
@@ -888,6 +888,10 @@ INLINE bool sema_resolve_symbol_common(SemaContext *context, NameResolve *name_r
|
||||
if (candidate) return name_resolve->found = candidate, true;
|
||||
}
|
||||
if (name_resolve->suppress_error) return name_resolve->found = NULL, true;
|
||||
if (context->generic_instance)
|
||||
{
|
||||
RETURN_SEMA_ERROR_AT(name_resolve->span, "'%s' is a generic %s. It was initialized in a generic context that didn't match its definition, so explicit parameters are needed.", found->name, decl_to_name(found));
|
||||
}
|
||||
RETURN_SEMA_ERROR_AT(name_resolve->span, "'%s' is a generic %s, did you forget the parameters '{ ... }'?", found->name, decl_to_name(found));
|
||||
}
|
||||
if (!name_resolve->is_parameterized) return true;
|
||||
|
||||
Reference in New Issue
Block a user