mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Improve error message for accidentally using a type as an expression statement
This commit is contained in:
+1
-1
@@ -1921,7 +1921,7 @@ gb_internal void check_expr_stmt(CheckerContext *ctx, Ast *node) {
|
|||||||
case Addressing_Type:
|
case Addressing_Type:
|
||||||
{
|
{
|
||||||
gbString str = type_to_string(operand.type);
|
gbString str = type_to_string(operand.type);
|
||||||
error(node, "'%s' is not an expression", str);
|
error(node, "'%s' is not an expression but a type and cannot be used as a statement", str);
|
||||||
gb_string_free(str);
|
gb_string_free(str);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user