aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-02 22:08:39 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-02 22:08:39 +0100
commitbc16b290ba6c2168baf1153b4c7691e679f68b46 (patch)
treeb18d799bde62c727111f042c0813a18e362e674a /src/check_decl.cpp
parent96d32680fe1b83ec943382efb8e91c7029f0621f (diff)
Disable polymorphic overloading in the global scope
TODO: Figure out why it does not work in the global scope
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 0826f59ca..14fd6f3ec 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -601,6 +601,8 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod
}
CheckerContext old_context = c->context;
+ defer (c->context = old_context);
+
c->context.scope = decl->scope;
c->context.decl = decl;
c->context.proc_name = proc_name;
@@ -660,7 +662,6 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod
check_scope_usage(c, c->context.scope);
- c->context = old_context;
if (decl->parent != NULL) {
// NOTE(bill): Add the dependencies from the procedure literal (lambda)