- Trying to slice an indexable type leads to misleading error message #2958

This commit is contained in:
Christoffer Lerno
2026-02-20 00:13:45 +01:00
parent 392c78860d
commit 0387d7666d
3 changed files with 10 additions and 1 deletions

View File

@@ -4848,7 +4848,7 @@ static inline bool sema_expr_analyse_slice(SemaContext *context, Expr *expr)
if (!inner_type || !type_is_valid_for_array(inner_type))
{
RETURN_SEMA_ERROR(subscripted, "Cannot index %s.", type_quoted_error_string(subscripted->type));
RETURN_SEMA_ERROR(subscripted, "You cannot slice %s.", type_quoted_error_string(subscripted->type));
}
if (current_expr != subscripted)
{