Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    r18e683b r417117e  
    370370                                                        // push empty tuple expression
    371371                                                        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{}, {} };
    375373                                                        argType = newResult.expr->result;
    376374                                                } else {
     
    548546                genStart = genEnd;
    549547
    550                 return genEnd != results.size();
     548                return genEnd != results.size();  // were any new results added?
    551549        }
    552550
     
    594592
    595593        /// 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:
    597597                CandidateFinder & selfFinder;
    598                 const ast::SymbolTable & symtab;
    599598                CandidateList & candidates;
    600599                const ast::TypeEnvironment & tenv;
     
    602601
    603602                Finder( CandidateFinder & f )
    604                 : selfFinder( f ), symtab( f.symtab ), candidates( f.candidates ), tenv( f.env ),
     603                : symtab( f.localSyms ), selfFinder( f ), candidates( f.candidates ), tenv( f.env ),
    605604                  targetType( f.targetType ) {}
    606605               
     
    676675                        ast::TypeEnvironment funcEnv{ func->env };
    677676                        makeUnifiableVars( funcType, funcOpen, funcNeed );
    678                         // add all type variables as open variables now so that those not used in the parameter
    679                         // list are still considered open
     677                        // add all type variables as open variables now so that those not used in the
     678                        // parameter list are still considered open
    680679                        funcEnv.add( funcType->forall );
    681680
     
    15581557                std::vector< std::string > errors;
    15591558                for ( CandidateRef & candidate : candidates ) {
    1560                         satisfyAssertions( candidate, symtab, satisfied, errors );
     1559                        satisfyAssertions( candidate, localSyms, satisfied, errors );
    15611560                }
    15621561
     
    16131612                        r->expr = ast::mutate_field(
    16141613                                r->expr.get(), &ast::Expr::result,
    1615                                 adjustExprType( r->expr->result, r->env, symtab ) );
     1614                                adjustExprType( r->expr->result, r->env, localSyms ) );
    16161615                }
    16171616        }
     
    16311630
    16321631        for ( const auto & x : xs ) {
    1633                 out.emplace_back( symtab, env );
     1632                out.emplace_back( localSyms, env );
    16341633                out.back().find( x, ResolvMode::withAdjustment() );
    16351634               
Note: See TracChangeset for help on using the changeset viewer.