Changes in src/ResolvExpr/Resolver.cc [b9f383f:bd87b138]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rb9f383f rbd87b138 492 492 } 493 493 494 if(clause.target.arguments.empty()) {495 SemanticError( stmt->location, "Waitfor clause must have at least one mutex parameter");496 }497 498 494 // Find all alternatives for all arguments in canonical form 499 495 std::vector< AlternativeFinder > argAlternatives; … … 560 556 auto param_end = function->parameters.end(); 561 557 562 int n_mutex_arg = 0;563 564 558 // For every arguments of its set, check if it matches one of the parameter 565 559 // The order is important … … 570 564 // We ran out of parameters but still have arguments 571 565 // 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" ); 573 567 } 574 568 575 n_mutex_arg++;576 577 569 // 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 ) ) { 579 571 // Type doesn't match 580 572 stringstream ss; 581 573 ss << "candidate function not viable: no known convertion from '"; 574 arg.expr->get_result()->print( ss ); 575 ss << "' to '"; 582 576 (*param)->get_type()->print( ss ); 583 ss << "' to '";584 arg.expr->get_result()->print( ss );585 577 ss << "'\n"; 586 578 SemanticError( function, ss.str() ); … … 596 588 // We ran out of arguments but still have parameters left 597 589 // 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" ); 599 591 } 600 592
Note:
See TracChangeset
for help on using the changeset viewer.