In typeresolution_info::visit_block(), we were catching and printing
semantic_errors, but this causes them to be repeated when type resolution
loops around again. Instead let higher levels catch the error, where it
will end the iteration properly too.
This probably originated on the assumption that all probe and function code
is contained in a block statement, but with optimization that may not even
be true, so visit_block is really not the right place to catch errors.
{
for (unsigned i=0; i<e->statements.size(); i++)
{
- try
- {
- t = pe_unknown;
- e->statements[i]->visit (this);
- }
- catch (const semantic_error& e)
- {
- session.print_error (e);
- }
+ t = pe_unknown;
+ e->statements[i]->visit (this);
}
}