Bad error message when using a generic method without generic parameters #1228

This commit is contained in:
Christoffer Lerno
2024-07-08 17:32:39 +02:00
parent 0e90ce3b8a
commit 0132fd4101
3 changed files with 13 additions and 2 deletions

View File

@@ -33,6 +33,7 @@
- Wrong size for structs containing overaligned structs #1219
- $typeof(*x) should be valid when x is an `[out]` parameter #1226
- Fix ABI lowering for 128 bit vectors on Linux.
- Bad error message when using a generic method without generic parameters #1228
### Stdlib changes
- Added `remove_first_item` `remove_last_item` and `remove_item` as aliases for the `match` functions.

View File

@@ -519,8 +519,9 @@ INLINE Decl *sema_resolve_symbol_common(SemaContext *context, NameResolve *name_
{
if (matches_subpath(module->name, name_resolve->path))
{
module_with_path = module;
break;
SEMA_ERROR(name_resolve->path, "%s is a generic module, did you forget to add the generic parameter(s) (<...>) after '%s'?",
module->name->module, name_resolve->symbol);
return poisoned_decl;
}
}
}

View File

@@ -0,0 +1,9 @@
module test;
import std;
import abc;
fn void main()
{
abc::test(); // #error: (<...>)
}
module abc(<Type>);
fn void test() {}