mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Bad error message when using a generic method without generic parameters #1228
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
test/test_suite/generic/generic_without_param.c3
Normal file
9
test/test_suite/generic/generic_without_param.c3
Normal file
@@ -0,0 +1,9 @@
|
||||
module test;
|
||||
import std;
|
||||
import abc;
|
||||
fn void main()
|
||||
{
|
||||
abc::test(); // #error: (<...>)
|
||||
}
|
||||
module abc(<Type>);
|
||||
fn void test() {}
|
||||
Reference in New Issue
Block a user