Ignore:
Timestamp:
Dec 21, 2016, 4:15:47 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
53e3b4a
Parents:
626dbc10
Message:

replace type variables in InstantiateGeneric?, fix call passTypeVars so that the correct type is passed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r626dbc10 rb940dc71  
    11271127                        makeTyVarMap( function, exprTyVars ); // xxx - should this take into account the variables already bound in scopeTyVars (i.e. remove them from exprTyVars?)
    11281128                        ReferenceToType *dynRetType = isDynRet( function, exprTyVars );
    1129                         Type *concRetType = appExpr->get_result()->isVoid() ? nullptr : appExpr->get_result();// ?: dynRetType; // xxx - is concRetType a good name?
    1130 
     1129
     1130                        // NOTE: addDynRetParam needs to know the actual (generated) return type so it can make a temp variable, so pass the result type from the appExpr
     1131                        // passTypeVars needs to know the program-text return type (i.e. the distinction between _conc_T30 and T3(int))
     1132                        // concRetType may not be a good name in one or both of these places. A more appropriate name change is welcome.
    11311133                        if ( dynRetType ) {
     1134                                Type *concRetType = appExpr->get_result()->isVoid() ? nullptr : appExpr->get_result();
    11321135                                ret = addDynRetParam( appExpr, function, concRetType, arg ); // xxx - used to use dynRetType instead of concRetType
    11331136                        } else if ( needsAdapter( function, scopeTyVars ) && ! needsAdapter( function, exprTyVars) ) { // xxx - exprTyVars is used above...?
     
    11421145                        arg = appExpr->get_args().begin();
    11431146
     1147                        Type *concRetType = replaceWithConcrete( appExpr, dynRetType );
    11441148                        passTypeVars( appExpr, concRetType, arg, exprTyVars ); // xxx - used to use dynRetType instead of concRetType; this changed so that the correct type paramaters are passed for return types (it should be the concrete type's parameters, not the formal type's)
    11451149                        addInferredParams( appExpr, function, arg, exprTyVars );
Note: See TracChangeset for help on using the changeset viewer.