aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-05-14 00:13:26 +0100
committergingerBill <bill@gingerbill.org>2020-05-14 00:13:26 +0100
commitf661d3404952d33d4cb683899ebd05d4b580b2bc (patch)
tree79f957be88db8740ebdf214a8107672f88a67052 /src/check_expr.cpp
parentaf1d4d6e72eeb75b32c40f3d4ca7bf6a78e8a043 (diff)
Implement Explicit context creation #639
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index d55692a41..159ae5e3a 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -7724,6 +7724,15 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
return kind;
}
+ if (unparen_expr(c->assignment_lhs_hint) == node) {
+ c->scope->flags |= ScopeFlag_ContextDefined;
+ }
+
+ if ((c->scope->flags & ScopeFlag_ContextDefined) == 0) {
+ error(node, "'context' has not been defined within this scope");
+ // Continue with value
+ }
+
init_core_context(c->checker);
o->mode = Addressing_Context;
o->type = t_context;