Change scoping rules to allow for shadowing of procedure parameters but not named return values

This commit is contained in:
gingerBill
2019-07-27 00:45:36 +01:00
parent d26033eb23
commit 40f0e74b8c
2 changed files with 37 additions and 12 deletions
+2 -2
View File
@@ -1141,7 +1141,7 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
}
ast_node(bs, BlockStmt, body);
// check_open_scope(ctx, body);
check_open_scope(ctx, body);
check_stmt_list(ctx, bs->stmts, Stmt_CheckScopeDecls);
if (type->Proc.result_count > 0) {
if (!check_is_terminating(body)) {
@@ -1153,7 +1153,7 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
}
}
}
// check_close_scope(ctx);
check_close_scope(ctx);
check_scope_usage(ctx->checker, ctx->scope);