Skip to content

Commit

Permalink
Propagate types for function arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdenniston committed Apr 3, 2015
1 parent fb755a3 commit def7d0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/TypeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ void TypeChecker::visit(FunctionCall *node) {
if (node->function->args[i]->type().defined()) {
bish_assert((*I)->type() == node->function->args[i]->type()) <<
"Invalid argument type for function call " << node->debug_info();
} else {
node->function->args[i]->set_type((*I)->type());
}
}
node->set_type(node->function->type());
Expand Down
2 changes: 1 addition & 1 deletion tools/TypeAnnotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ int main(int argc, char **argv) {
CodeGenerators::CodeGeneratorConstructor cg_constructor =
CodeGenerators::get("bash");
assert(cg_constructor);
compile_to(m, cg_constructor(s));
compile(m, cg_constructor(s));

TypeAnnotator annotate(std::cout);
m->accept(&annotate);
Expand Down

0 comments on commit def7d0f

Please sign in to comment.