- Timestamp:
- Aug 13, 2024, 6:17:27 PM (3 months ago)
- Branches:
- master
- Children:
- 1a2ba84, d1f5054
- Parents:
- 661e7b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
r661e7b0 r2870cb6 1281 1281 // count one safe conversion for each value that is thrown away 1282 1282 thisCost.incSafe( discardedValues ); 1283 1284 // See Aaron Moss, page 47; this reasoning does not hold since implicit conversions 1285 // can create the same resolution issue. The C intrinsic interpretations are pruned 1286 // immediately for the lowest cost option regardless of result type. Related code in 1287 // postvisit (UntypedExpr). 1288 // Cast expression costs are updated now to use the general rules. 1289 /* 1283 1290 // select first on argument cost, then conversion cost 1284 1291 if ( cand->cost < minExprCost || ( cand->cost == minExprCost && thisCost < minCastCost ) ) { … … 1289 1296 // ambigious case, still output candidates to print in error message 1290 1297 if ( cand->cost == minExprCost && thisCost == minCastCost ) { 1298 */ 1299 cand->cost += thisCost; 1300 if (cand->cost < minExprCost) { 1301 minExprCost = cand->cost; 1302 matches.clear(); 1303 } 1304 if (cand->cost == minExprCost) { 1291 1305 CandidateRef newCand = std::make_shared<Candidate>( 1292 1306 restructureCast( cand->expr, toType, castExpr->isGenerated ), 1293 copy( cand->env ), std::move( open ), std::move( need ), cand->cost + thisCost);1307 copy( cand->env ), std::move( open ), std::move( need ), cand->cost); 1294 1308 // currently assertions are always resolved immediately so this should have no effect. 1295 1309 // if this somehow changes in the future (e.g. delayed by indeterminate return type)
Note: See TracChangeset
for help on using the changeset viewer.