Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ResolveAssertions.cc

    r4d2d45f9 re1f7eef  
    2020#include <list>                     // for list
    2121#include <memory>                   // for unique_ptr
    22 #include <sstream>                  // for ostringstream
    23 #include <string>                   // for string
     22#include <string>
    2423#include <unordered_map>            // for unordered_map, unordered_multimap
    2524#include <utility>                  // for move
     
    2827#include "Alternative.h"            // for Alternative, AssertionItem, AssertionList
    2928#include "Common/FilterCombos.h"    // for filterCombos
    30 #include "Common/Indenter.h"        // for Indenter
    3129#include "Common/utility.h"         // for sort_mins
    3230#include "ResolvExpr/RenameVars.h"  // for renameTyVars
     
    9997                        return { item, item.matches[i] };
    10098                }
    101 
    102                 const DeclarationWithType* get_decl() const { return cache->at(key).deferIds[0].decl; }
    10399
    104100                // sortable by key
     
    368364        static const int recursionLimit = /* 10 */ 4;
    369365
    370         void resolveAssertions( Alternative& alt, const SymTab::Indexer& indexer, AltList& out, std::list<std::string>& errors ) {
     366        void resolveAssertions( Alternative& alt, const SymTab::Indexer& indexer, AltList& out ) {
    371367                // finish early if no assertions to resolve
    372368                if ( alt.need.empty() ) {
     
    389385                                for ( auto& assn : resn.need ) {
    390386                                        // fail early if any assertion is not resolvable
    391                                         if ( ! resolveAssertion( assn, resn, assnCache ) ) {
    392                                                 Indenter tabs{ Indenter::tabsize, 3 };
    393                                                 std::ostringstream ss;
    394                                                 ss << tabs << "Unsatisfiable alternative:\n";
    395                                                 resn.alt.print( ss, ++tabs );
    396                                                 ss << --tabs << "Could not satisfy assertion:\n";
    397                                                 assn.decl->print( ss, ++tabs );
    398                                                
    399                                                 errors.emplace_back( ss.str() );
    400                                                 goto nextResn;
    401                                         }
     387                                        if ( ! resolveAssertion( assn, resn, assnCache ) ) goto nextResn;
    402388                                }
    403389
     
    418404                                                resn.deferred,
    419405                                                CandidateEnvMerger{ resn.alt.env, resn.alt.openVars, resn.indexer } );
    420                                         // fail early if no mutually-compatible assertion satisfaction
    421                                         if ( compatible.empty() ) {
    422                                                 Indenter tabs{ Indenter::tabsize, 3 };
    423                                                 std::ostringstream ss;
    424                                                 ss << tabs << "Unsatisfiable alternative:\n";
    425                                                 resn.alt.print( ss, ++tabs );
    426                                                 ss << --tabs << "No mutually-compatible satisfaction for assertions:\n";
    427                                                 ++tabs;
    428                                                 for ( const auto& d : resn.deferred ) {
    429                                                         d.get_decl()->print( ss, tabs );
    430                                                 }
    431 
    432                                                 errors.emplace_back( ss.str() );
    433                                                 goto nextResn;
    434                                         }
    435406                                        // sort by cost
    436407                                        CandidateCost coster{ resn.indexer };
Note: See TracChangeset for help on using the changeset viewer.