Changeset c5283ba for src/ResolvExpr


Ignore:
Timestamp:
Jun 29, 2018, 3:02:51 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
1f133dc
Parents:
9f66811
Message:

Fixed #94, properly list the number of expected mutex parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r9f66811 rc5283ba  
    583583                                                        // Make sure we don't widen any existing bindings
    584584                                                        resultEnv.forbidWidening();
    585                                                        
     585
    586586                                                        // Find any unbound type variables
    587587                                                        resultEnv.extractOpenVars( openVars );
     
    590590                                                        auto param_end = function->parameters.end();
    591591
    592                                                         int n_mutex_arg = 0;
     592                                                        int n_mutex_param = 0;
    593593
    594594                                                        // For every arguments of its set, check if it matches one of the parameter
     
    600600                                                                        // We ran out of parameters but still have arguments
    601601                                                                        // this function doesn't match
    602                                                                         SemanticError( function, toString("candidate function not viable: too many mutex arguments, expected ", n_mutex_arg, "\n" ));
     602                                                                        SemanticError( function, toString("candidate function not viable: too many mutex arguments, expected ", n_mutex_param, "\n" ));
    603603                                                                }
    604604
    605                                                                 n_mutex_arg++;
     605                                                                n_mutex_param++;
    606606
    607607                                                                // Check if the argument matches the parameter type in the current scope
     
    626626                                                        // Check if parameters are missing
    627627                                                        if( advance_to_mutex( param, param_end ) ) {
     628                                                                do {
     629                                                                        n_mutex_param++;
     630                                                                        param++;
     631                                                                } while( advance_to_mutex( param, param_end ) );
     632
    628633                                                                // We ran out of arguments but still have parameters left
    629634                                                                // this function doesn't match
    630                                                                 SemanticError( function, toString("candidate function not viable: too few mutex arguments, expected ", n_mutex_arg, "\n" ));
     635                                                                SemanticError( function, toString("candidate function not viable: too few mutex arguments, expected ", n_mutex_param, "\n" ));
    631636                                                        }
    632637
Note: See TracChangeset for help on using the changeset viewer.