Changeset b9f383f for src/ResolvExpr
- Timestamp:
- Apr 27, 2018, 2:35:00 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 5527759
- Parents:
- de6319f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rde6319f rb9f383f 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 494 498 // Find all alternatives for all arguments in canonical form 495 499 std::vector< AlternativeFinder > argAlternatives; … … 556 560 auto param_end = function->parameters.end(); 557 561 562 int n_mutex_arg = 0; 563 558 564 // For every arguments of its set, check if it matches one of the parameter 559 565 // The order is important … … 564 570 // We ran out of parameters but still have arguments 565 571 // this function doesn't match 566 SemanticError( function, "candidate function not viable: too many mutex arguments\n");572 SemanticError( function, toString("candidate function not viable: too many mutex arguments, expected ", n_mutex_arg, "\n" )); 567 573 } 568 574 575 n_mutex_arg++; 576 569 577 // Check if the argument matches the parameter type in the current scope 570 if( ! unify( (*param)->get_type(), arg.expr->get_result(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) {578 if( ! unify( arg.expr->get_result(), (*param)->get_type(), resultEnv, resultNeed, resultHave, openVars, this->indexer ) ) { 571 579 // Type doesn't match 572 580 stringstream ss; 573 581 ss << "candidate function not viable: no known convertion from '"; 582 (*param)->get_type()->print( ss ); 583 ss << "' to '"; 574 584 arg.expr->get_result()->print( ss ); 575 ss << "' to '";576 (*param)->get_type()->print( ss );577 585 ss << "'\n"; 578 586 SemanticError( function, ss.str() ); … … 588 596 // We ran out of arguments but still have parameters left 589 597 // this function doesn't match 590 SemanticError( function, "candidate function not viable: too few mutex arguments\n");598 SemanticError( function, toString("candidate function not viable: too few mutex arguments, expected ", n_mutex_arg, "\n" )); 591 599 } 592 600
Note: See TracChangeset
for help on using the changeset viewer.