浏览代码

Add `Suggestion: 'context = runtime.default_context()'`

gingerBill 4 月之前
父节点
当前提交
594f1b30b4
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/check_expr.cpp

+ 2 - 0
src/check_expr.cpp

@@ -8076,7 +8076,9 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
 
 
 	if (pt->kind == Type_Proc && pt->Proc.calling_convention == ProcCC_Odin) {
 	if (pt->kind == Type_Proc && pt->Proc.calling_convention == ProcCC_Odin) {
 		if ((c->scope->flags & ScopeFlag_ContextDefined) == 0) {
 		if ((c->scope->flags & ScopeFlag_ContextDefined) == 0) {
+			ERROR_BLOCK();
 			error(call, "'context' has not been defined within this scope, but is required for this procedure call");
 			error(call, "'context' has not been defined within this scope, but is required for this procedure call");
+			error_line("\tSuggestion: 'context = runtime.default_context()'");
 		}
 		}
 	}
 	}