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