mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Error message with hashmap shows "mangled" name instead of original #2562.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
- Fix division-by-zero checks on `a /= 0` and `b /= 0f` #2558.
|
||||
- Fix fmod `a %= 0f`.
|
||||
- Regression vector ABI: initializing a struct containing a NPOT vector with a constant value would crash LLVM. #2559
|
||||
- Error message with hashmap shows "mangled" name instead of original #2562.
|
||||
|
||||
### Stdlib changes
|
||||
|
||||
|
||||
@@ -355,7 +355,14 @@ static const char *type_to_error_string_with_path(Type *type)
|
||||
Decl *decl = type->decl;
|
||||
const char *suffix = decl->unit->module->generic_suffix;
|
||||
scratch_buffer_clear();
|
||||
scratch_buffer_append(decl->unit->module->name->module);
|
||||
if (decl->unit->module->generic_module)
|
||||
{
|
||||
scratch_buffer_append(decl->unit->module->generic_module->name->module);
|
||||
}
|
||||
else
|
||||
{
|
||||
scratch_buffer_append(decl->unit->module->name->module);
|
||||
}
|
||||
scratch_buffer_append("::");
|
||||
if (suffix || type_is_inner_type(type))
|
||||
{
|
||||
|
||||
10
test/test_suite/generic/generic_error_out.c3
Normal file
10
test/test_suite/generic/generic_error_out.c3
Normal file
@@ -0,0 +1,10 @@
|
||||
module test;
|
||||
import std::collections::map;
|
||||
|
||||
fn void foo(HashMap{char[], String}* f) { }
|
||||
|
||||
fn void main()
|
||||
{
|
||||
HashMap{char[], char[]} x;
|
||||
foo(&x); // #error: Implicitly casting 'std::collections::map::HashMap{char[], char[]}*' to 'std::collections::map::HashMap{char[], String}*' is not permitted, but you may do an explicit cast by placing '(std::collections::map::HashMap{char[], String}*)' before the expression
|
||||
}
|
||||
Reference in New Issue
Block a user