Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rb9f383f rbd87b138  
    492492                        }
    493493
    494                         if(clause.target.arguments.empty()) {
    495                                 SemanticError( stmt->location, "Waitfor clause must have at least one mutex parameter");
    496                         }
    497 
    498494                        // Find all alternatives for all arguments in canonical form
    499495                        std::vector< AlternativeFinder > argAlternatives;
     
    560556                                                        auto param_end = function->parameters.end();
    561557
    562                                                         int n_mutex_arg = 0;
    563 
    564558                                                        // For every arguments of its set, check if it matches one of the parameter
    565559                                                        // The order is important
     
    570564                                                                        // We ran out of parameters but still have arguments
    571565                                                                        // this function doesn't match
    572                                                                         SemanticError( function, toString("candidate function not viable: too many mutex arguments, expected ", n_mutex_arg, "\n" ));
     566                                                                        SemanticError( function, "candidate function not viable: too many mutex arguments\n" );
    573567                                                                }
    574568
    575                                                                 n_mutex_arg++;
    576 
    577569                                                                // Check if the argument matches the parameter type in the current scope
    578                                                                 if( ! unify( arg.expr->get_result(), (*param)->get_type(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {
     570                                                                if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {
    579571                                                                        // Type doesn't match
    580572                                                                        stringstream ss;
    581573                                                                        ss << "candidate function not viable: no known convertion from '";
     574                                                                        arg.expr->get_result()->print( ss );
     575                                                                        ss << "' to '";
    582576                                                                        (*param)->get_type()->print( ss );
    583                                                                         ss << "' to '";
    584                                                                         arg.expr->get_result()->print( ss );
    585577                                                                        ss << "'\n";
    586578                                                                        SemanticError( function, ss.str() );
     
    596588                                                                // We ran out of arguments but still have parameters left
    597589                                                                // this function doesn't match
    598                                                                 SemanticError( function, toString("candidate function not viable: too few mutex arguments, expected ", n_mutex_arg, "\n" ));
     590                                                                SemanticError( function, "candidate function not viable: too few mutex arguments\n" );
    599591                                                        }
    600592
Note: See TracChangeset for help on using the changeset viewer.