aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 4d3268f44..e6812b81d 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -7411,6 +7411,12 @@ ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *call, Type *t
Type *pt = base_type(proc_type);
+ if (pt->kind == Type_Proc && pt->Proc.calling_convention == ProcCC_Odin) {
+ if ((c->scope->flags & ScopeFlag_ContextDefined) == 0) {
+ error(call, "'context' has not been defined within this scope, but is required for this procedure call");
+ }
+ }
+
#if 0
if (pt->kind == Type_Proc && pt->Proc.calling_convention == ProcCC_Odin) {
init_core_context(c->checker);