Mark some definitions as global, so as not to capture them.
This commit is contained in:
10
12/main.cpp
10
12/main.cpp
@@ -33,10 +33,10 @@ void typecheck_program(
|
||||
type_ptr binop_type = type_ptr(new type_arr(
|
||||
int_type_app,
|
||||
type_ptr(new type_arr(int_type_app, int_type_app))));
|
||||
env->bind("+", binop_type);
|
||||
env->bind("-", binop_type);
|
||||
env->bind("*", binop_type);
|
||||
env->bind("/", binop_type);
|
||||
env->bind("+", binop_type, visibility::global);
|
||||
env->bind("-", binop_type, visibility::global);
|
||||
env->bind("*", binop_type, visibility::global);
|
||||
env->bind("/", binop_type, visibility::global);
|
||||
|
||||
std::set<std::string> free;
|
||||
defs.find_free(mgr, env, free);
|
||||
@@ -44,7 +44,7 @@ void typecheck_program(
|
||||
|
||||
for(auto& pair : defs.env->names) {
|
||||
std::cout << pair.first << ": ";
|
||||
pair.second->print(mgr, std::cout);
|
||||
pair.second.type->print(mgr, std::cout);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user