- File:
-
- 1 edited
-
src/ResolvExpr/CandidateFinder.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
r417117e r18e683b 370 370 // push empty tuple expression 371 371 newResult.parent = i; 372 newResult.expr = new ast::TupleExpr{ CodeLocation{}, {} }; 372 std::vector< ast::ptr< ast::Expr > > emptyList; 373 newResult.expr = 374 new ast::TupleExpr{ CodeLocation{}, move( emptyList ) }; 373 375 argType = newResult.expr->result; 374 376 } else { … … 546 548 genStart = genEnd; 547 549 548 return genEnd != results.size(); // were any new results added?550 return genEnd != results.size(); 549 551 } 550 552 … … 592 594 593 595 /// Actually visits expressions to find their candidate interpretations 594 class Finder final : public ast::WithShortCircuiting { 596 struct Finder final : public ast::WithShortCircuiting { 597 CandidateFinder & selfFinder; 595 598 const ast::SymbolTable & symtab; 596 public:597 CandidateFinder & selfFinder;598 599 CandidateList & candidates; 599 600 const ast::TypeEnvironment & tenv; … … 601 602 602 603 Finder( CandidateFinder & f ) 603 : s ymtab( f.localSyms ), selfFinder( f), candidates( f.candidates ), tenv( f.env ),604 : selfFinder( f ), symtab( f.symtab ), candidates( f.candidates ), tenv( f.env ), 604 605 targetType( f.targetType ) {} 605 606 … … 675 676 ast::TypeEnvironment funcEnv{ func->env }; 676 677 makeUnifiableVars( funcType, funcOpen, funcNeed ); 677 // add all type variables as open variables now so that those not used in the 678 // parameterlist are still considered open678 // add all type variables as open variables now so that those not used in the parameter 679 // list are still considered open 679 680 funcEnv.add( funcType->forall ); 680 681 … … 1557 1558 std::vector< std::string > errors; 1558 1559 for ( CandidateRef & candidate : candidates ) { 1559 satisfyAssertions( candidate, localSyms, satisfied, errors );1560 satisfyAssertions( candidate, symtab, satisfied, errors ); 1560 1561 } 1561 1562 … … 1612 1613 r->expr = ast::mutate_field( 1613 1614 r->expr.get(), &ast::Expr::result, 1614 adjustExprType( r->expr->result, r->env, localSyms) );1615 adjustExprType( r->expr->result, r->env, symtab ) ); 1615 1616 } 1616 1617 } … … 1630 1631 1631 1632 for ( const auto & x : xs ) { 1632 out.emplace_back( localSyms, env );1633 out.emplace_back( symtab, env ); 1633 1634 out.back().find( x, ResolvMode::withAdjustment() ); 1634 1635
Note:
See TracChangeset
for help on using the changeset viewer.