Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    r417117e r18e683b  
    370370                                                        // push empty tuple expression
    371371                                                        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 ) };
    373375                                                        argType = newResult.expr->result;
    374376                                                } else {
     
    546548                genStart = genEnd;
    547549
    548                 return genEnd != results.size();  // were any new results added?
     550                return genEnd != results.size();
    549551        }
    550552
     
    592594
    593595        /// 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;
    595598                const ast::SymbolTable & symtab;
    596         public:
    597                 CandidateFinder & selfFinder;
    598599                CandidateList & candidates;
    599600                const ast::TypeEnvironment & tenv;
     
    601602
    602603                Finder( CandidateFinder & f )
    603                 : symtab( f.localSyms ), selfFinder( f ), candidates( f.candidates ), tenv( f.env ),
     604                : selfFinder( f ), symtab( f.symtab ), candidates( f.candidates ), tenv( f.env ),
    604605                  targetType( f.targetType ) {}
    605606               
     
    675676                        ast::TypeEnvironment funcEnv{ func->env };
    676677                        makeUnifiableVars( funcType, funcOpen, funcNeed );
    677                         // add all type variables as open variables now so that those not used in the
    678                         // parameter list are still considered open
     678                        // add all type variables as open variables now so that those not used in the parameter
     679                        // list are still considered open
    679680                        funcEnv.add( funcType->forall );
    680681
     
    15571558                std::vector< std::string > errors;
    15581559                for ( CandidateRef & candidate : candidates ) {
    1559                         satisfyAssertions( candidate, localSyms, satisfied, errors );
     1560                        satisfyAssertions( candidate, symtab, satisfied, errors );
    15601561                }
    15611562
     
    16121613                        r->expr = ast::mutate_field(
    16131614                                r->expr.get(), &ast::Expr::result,
    1614                                 adjustExprType( r->expr->result, r->env, localSyms ) );
     1615                                adjustExprType( r->expr->result, r->env, symtab ) );
    16151616                }
    16161617        }
     
    16301631
    16311632        for ( const auto & x : xs ) {
    1632                 out.emplace_back( localSyms, env );
     1633                out.emplace_back( symtab, env );
    16331634                out.back().find( x, ResolvMode::withAdjustment() );
    16341635               
Note: See TracChangeset for help on using the changeset viewer.