소스 검색

Improve error message for accidentally using a type as an expression statement

gingerBill 2 년 전
부모
커밋
ee4ed126e1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/check_stmt.cpp

+ 1 - 1
src/check_stmt.cpp

@@ -1921,7 +1921,7 @@ gb_internal void check_expr_stmt(CheckerContext *ctx, Ast *node) {
 	case Addressing_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);
 			break;
 		}