Changeset bd78797


Ignore:
Timestamp:
Jan 17, 2019, 1:34:42 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
da6032af, ec7f50a
Parents:
c9aba81
Message:

closes #118

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    rc9aba81 rbd78797  
    474474                }
    475475
    476                 // mark specialization cost of return types
    477                 for ( DeclarationWithType* returnVal : function->returnVals ) {
    478                         convCost.decSpec( specCost( returnVal->get_type() ) );
    479                 }
     476                // specialization cost of return types can't be accounted for directly, it disables
     477                // otherwise-identical calls, like this example based on auto-newline in the I/O lib:
     478                //
     479                //   forall(otype OS) {
     480                //     void ?|?(OS&, int);  // with newline
     481                //     OS&  ?|?(OS&, int);  // no newline, always chosen due to more specialization
     482                //   }
    480483
    481484                // mark type variable and specialization cost of forall clause
     
    12291232                                Alternative newAlt{
    12301233                                        restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ),
    1231                                         alt.env, openVars, needAssertions, alt.cost + thisCost, thisCost };
     1234                                        alt.env, openVars, needAssertions, alt.cost, alt.cost + thisCost };
    12321235                                inferParameters( newAlt, back_inserter( candidates ) );
    12331236                        } // if
Note: See TracChangeset for help on using the changeset viewer.