Переглянути джерело

Merge pull request #3119 from Kelimion/location_call

Clarify #location error message when not a call.
Jeroen van Rijn 1 рік тому
батько
коміт
5a542c7ad5
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      src/check_expr.cpp

+ 1 - 1
src/check_expr.cpp

@@ -7895,7 +7895,7 @@ gb_internal ExprKind check_basic_directive_expr(CheckerContext *c, Operand *o, A
 	} else {
 		if (name == "location") {
 			init_core_source_code_location(c->checker);
-			error(node, "'#%.*s' must be used in a call expression", LIT(name));
+			error(node, "'#location' must be used as a call, i.e. #location(proc), where #location() defaults to the procedure in which it was used.");
 			o->type = t_source_code_location;
 			o->mode = Addressing_Value;
 		} else if (