Ignore:
Timestamp:
Oct 13, 2016, 11:19:23 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, 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, resolv-new, with_gc
Children:
7756647
Parents:
65660bd
Message:

consider tuples managed if a tuple constructor is declared, combine environments in tuple assignment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    r65660bd rac9ca96  
    142142                for ( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i ) {
    143143                        ResolvExpr::AlternativeFinder finder( currentFinder.get_indexer(), currentFinder.get_environ() );
    144                         finder.findWithAdjustment(*i);
     144                        try {
     145                                finder.findWithAdjustment(*i);
     146                        } catch (...) {
     147                                return; // xxx - no match should not mean failure, it just means this particular tuple assignment isn't valid
     148                        }
    145149                        // prune expressions that don't coincide with
    146150                        ResolvExpr::AltList alts = finder.get_alternatives();
     
    157161                }
    158162                // xxx - need to do this??
    159                 // TypeEnvironment compositeEnv;
    160                 // simpleCombineEnvironments( i->begin(), i->end(), compositeEnv );
    161                 currentFinder.get_alternatives().push_front( ResolvExpr::Alternative(new TupleAssignExpr(solved_assigns, matcher->tmpDecls), currentFinder.get_environ(), ResolvExpr::sumCost( current ) ) );
     163                ResolvExpr::TypeEnvironment compositeEnv;
     164                simpleCombineEnvironments( current.begin(), current.end(), compositeEnv );
     165                currentFinder.get_alternatives().push_front( ResolvExpr::Alternative(new TupleAssignExpr(solved_assigns, matcher->tmpDecls), compositeEnv, ResolvExpr::sumCost( current ) ) );
    162166        }
    163167
Note: See TracChangeset for help on using the changeset viewer.