diff options
| author | gingerBill <ginger.bill.22@gmail.com> | 2016-08-15 21:22:44 +0100 |
|---|---|---|
| committer | gingerBill <ginger.bill.22@gmail.com> | 2016-08-15 21:22:44 +0100 |
| commit | 50fd9548b95f3929295be632619c20732094c93c (patch) | |
| tree | 1e4a97b4482ca4f32a600475a410561731ed1efd /src/checker/expr.cpp | |
| parent | dcbb2fcfbdbd3b35ddc44a4c542b7c6375e47214 (diff) | |
Win32 test
Diffstat (limited to 'src/checker/expr.cpp')
| -rw-r--r-- | src/checker/expr.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/checker/expr.cpp b/src/checker/expr.cpp index 204d27819..41360f72c 100644 --- a/src/checker/expr.cpp +++ b/src/checker/expr.cpp @@ -1807,7 +1807,7 @@ ExpressionKind check__expr_base(Checker *c, Operand *o, AstNode *node, Type *typ case Token_Float: t = t_untyped_float; break; case Token_String: t = t_untyped_string; break; case Token_Rune: t = t_untyped_rune; break; - default: GB_PANIC("Unknown literal"); break; + default: GB_PANIC("Unknown literal"); break; } o->mode = Addressing_Constant; o->type = t; @@ -1815,16 +1815,16 @@ ExpressionKind check__expr_base(Checker *c, Operand *o, AstNode *node, Type *typ case_end; case_ast_node(pl, ProcLit, node); + auto curr_context = c->context; + c->context.scope = c->global_scope; + check_open_scope(c, pl->type); + c->context.decl = make_declaration_info(c->allocator, c->context.scope); + defer ({ + check_close_scope(c); + c->context = curr_context; + }); Type *proc_type = check_type(c, pl->type); if (proc_type != NULL) { - auto context = c->context; - c->context.scope = c->global_scope; - check_open_scope(c, pl->type); - c->context.decl = make_declaration_info(c->allocator, c->context.scope); - defer ({ - c->context = context; - check_close_scope(c); - }); check_proc_body(c, empty_token, c->context.decl, proc_type, pl->body); o->mode = Addressing_Value; o->type = proc_type; |