Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/SatisfyAssertions.cpp

    r1958fec r3e5dd913  
    202202                        ast::ptr< ast::Type > toType = assn.first->result;
    203203                        ast::ptr< ast::Type > adjType =
    204                                 renameTyVars( adjustExprType( candidate->get_type(), newEnv, sat.symtab ), GEN_USAGE, false );
     204                                renameTyVars( adjustExprType( candidate->get_type(), newEnv, sat.symtab ) );
    205205
    206206                        // only keep candidates which unify
     
    385385
    386386        /// Limit to depth of recursion of assertion satisfaction
    387         static const int recursionLimit = 8;
     387        static const int recursionLimit = 4;
    388388        /// Maximum number of simultaneously-deferred assertions to attempt concurrent satisfaction of
    389389        static const int deferLimit = 10;
     
    417417                        if ( it != thresholds.end() && it->second < sat.costs ) goto nextSat;
    418418
    419                         // should a limit be imposed? worst case here is O(n^2) but very unlikely to happen.
    420                         for (unsigned resetCount = 0; ; ++resetCount) {
    421                                 ast::AssertionList next;
    422                                 resetTyVarRenaming();
    423                                 // make initial pass at matching assertions
    424                                 for ( auto & assn : sat.need ) {
    425                                         // fail early if any assertion is not satisfiable
    426                                         if ( ! satisfyAssertion( assn, sat ) ) {
    427                                                 next.emplace_back(assn);
    428                                                 // goto nextSat;
    429                                         }
    430                                 }
    431                                 // success
    432                                 if (next.empty()) break;
    433                                 // fail if nothing resolves
    434                                 else if (next.size() == sat.need.size()) {
     419                        // make initial pass at matching assertions
     420                        for ( auto & assn : sat.need ) {
     421                                // fail early if any assertion is not satisfiable
     422                                if ( ! satisfyAssertion( assn, sat ) ) {
    435423                                        Indenter tabs{ 3 };
    436424                                        std::ostringstream ss;
     
    438426                                        print( ss, *sat.cand, ++tabs );
    439427                                        ss << (tabs-1) << "Could not satisfy assertion:\n";
    440                                         ast::print( ss, next[0].first, tabs );
     428                                        ast::print( ss, assn.first, tabs );
    441429
    442430                                        errors.emplace_back( ss.str() );
    443431                                        goto nextSat;
    444432                                }
    445                                 sat.need = std::move(next);
    446433                        }
    447434
Note: See TracChangeset for help on using the changeset viewer.