Changeset 40290497 for src/ResolvExpr


Ignore:
Timestamp:
Nov 20, 2018, 3:14:03 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
83ab931
Parents:
0b00df0
Message:

Fiddle with missing inferParams handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ResolveAssertions.cc

    r0b00df0 r40290497  
    300300
    301301                Expression* postmutate( Expression* expr ) {
     302                        // defer missing inferred parameters until they are hopefully found later
     303                        std::vector<UniqueId> missingSlots;
    302304                        // place inferred parameters into resolution slots
    303305                        for ( UniqueId slot : expr->resnSlots ) {
    304306                                // fail if no matching parameters found
    305                                 InferredParams& inferParams = inferred.at( slot );
     307                                auto it = inferred.find( slot );
     308                                if ( it == inferred.end() ) {
     309                                        missingSlots.push_back( slot );
     310                                        continue;
     311                                }
     312                                InferredParams& inferParams = it->second;
    306313                               
    307314                                // place inferred parameters into proper place in expression
     
    315322
    316323                        // clear resolution slots and return
    317                         expr->resnSlots.clear();
     324                        expr->resnSlots.swap( missingSlots );
    318325                        return expr;
    319326                }
Note: See TracChangeset for help on using the changeset viewer.