Correctly mention aliased type when method is not implemented #2534.

This commit is contained in:
Christoffer Lerno
2025-10-20 00:19:51 +02:00
parent 4af31da7ea
commit 6169d7acdf
3 changed files with 9 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
- Fix issues with linking when using symbol aliases. #2519
- Splatting optional compile-time macro parameter from inside lambda expression does not work #2532.
- Compiler segfault when getting a nonexistant member from an unnamed struct #2533.
- Correctly mention aliased type when method is not implemented #2534.
### Stdlib changes
- Sorting functions correctly took slices by value, but also other types by value. Now, only slices are accepted by value, other containers are always by ref.

View File

@@ -6272,7 +6272,7 @@ CHECK_DEEPER:
if (!method)
{
if (missing_ref) goto MISSING_REF;
RETURN_SEMA_ERROR(expr, "There is no member or method '%s' on '%s'", kw, type_to_error_string(parent->type));
RETURN_SEMA_ERROR(expr, "There is no member or method '%s' on %s", kw, type_quoted_error_string(parent->type));
}
ASSERT_SPAN(expr, expr->expr_kind == EXPR_ACCESS_UNRESOLVED);

View File

@@ -0,0 +1,7 @@
alias MyChar = char;
fn void main()
{
MyChar my = '1';
my.ok(); // #error: There is no member or method 'ok' on 'MyChar' (char)
}