mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix error message when not finding a particular function
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
- Fix bugs in "trap-on-wrap" #1434.
|
||||
- Bug with casting anyfault to error.
|
||||
- Lambda / function type would accidentally be processed as a method.
|
||||
- Fix error message when not finding a particular function.
|
||||
|
||||
### Stdlib changes
|
||||
- Additional init functions for hashmap.
|
||||
|
||||
@@ -687,10 +687,22 @@ INLINE bool sema_resolve_symbol_common(SemaContext *context, NameResolve *name_r
|
||||
{
|
||||
if (matches_subpath(module->name, name_resolve->path))
|
||||
{
|
||||
module_with_path = module;
|
||||
break;
|
||||
FOREACH(Decl *, import, context->unit->imports)
|
||||
{
|
||||
Module *mod = module;
|
||||
while (mod)
|
||||
{
|
||||
if (import->import.module == mod)
|
||||
{
|
||||
module_with_path = module;
|
||||
goto MOD_FOUND;
|
||||
}
|
||||
mod = mod->parent_module;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MOD_FOUND:
|
||||
if (!module_with_path)
|
||||
{
|
||||
FOREACH(Module *, module, compiler.context.generic_module_list)
|
||||
@@ -707,7 +719,7 @@ INLINE bool sema_resolve_symbol_common(SemaContext *context, NameResolve *name_r
|
||||
{
|
||||
RETURN_SEMA_ERROR(name_resolve, "'%s' could not be found in %s.", name_resolve->symbol, module_with_path->name->module);
|
||||
}
|
||||
RETURN_SEMA_ERROR(name_resolve->path, "Unknown module '%.*s', did you type it right?", name_resolve->path->len, name_resolve->path->module);
|
||||
RETURN_SEMA_ERROR(name_resolve->path, "No '%.*s' module was imported, did you type it right?", name_resolve->path->len, name_resolve->path->module);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user