Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    reb7586e rfc1a3e2  
    906906                                }
    907907                                CandidateRef & choice = winners.front();
    908                                 choice->cost.incSafe();
     908                                choice->cost.incVar();
    909909                                candidates.emplace_back( std::move(choice) );
    910910                        }
     
    13761376                        ast::Expr * newExpr = data.combine( nameExpr->location, cost );
    13771377
    1378                         // bool bentConversion = false;
    1379                         // if ( auto inst = newExpr->result.as<ast::EnumInstType>() ) {
    1380                         //      if ( inst->base && inst->base->base ) {
    1381                         //              bentConversion = true;
    1382                         //      }
    1383                         // }
    1384 
    1385                         // CandidateRef newCand = std::make_shared<Candidate>(
    1386                         //      newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, bentConversion? Cost::safe: Cost::zero,
    1387                         //      cost );
     1378                        bool bentConversion = false;
     1379                        if ( auto inst = newExpr->result.as<ast::EnumInstType>() ) {
     1380                                if ( inst->base && inst->base->base ) {
     1381                                        bentConversion = true;
     1382                                }
     1383                        }
     1384
    13881385                        CandidateRef newCand = std::make_shared<Candidate>(
    1389                                 newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, Cost::zero,
     1386                                newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, bentConversion? Cost::safe: Cost::zero,
    13901387                                cost );
     1388
    13911389                        if (newCand->expr->env) {
    13921390                                newCand->env.add(*newCand->expr->env);
     
    18311829                                        Cost cost = Cost::zero;
    18321830                                        ast::Expr * newExpr = data.combine( expr->location, cost );
    1833                                         // CandidateRef newCand =
    1834                                         //      std::make_shared<Candidate>(
    1835                                         //              newExpr, copy( tenv ), ast::OpenVarSet{},
    1836                                         //              ast::AssertionSet{}, Cost::safe, cost
    1837                                         //      );
    18381831                                        CandidateRef newCand =
    18391832                                                std::make_shared<Candidate>(
    18401833                                                        newExpr, copy( tenv ), ast::OpenVarSet{},
    1841                                                         ast::AssertionSet{}, Cost::zero, cost
     1834                                                        ast::AssertionSet{}, Cost::safe, cost
    18421835                                                );
     1836
    18431837                                        if (newCand->expr->env) {
    18441838                                                newCand->env.add(*newCand->expr->env);
Note: See TracChangeset for help on using the changeset viewer.