- Timestamp:
- Dec 2, 2022, 9:53:16 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- aadb0c8
- Parents:
- a84f643
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
ra84f643 r474a170 95 95 /// Pass the extra type parameters from polymorphic generic arguments or return types into a function application 96 96 /// Will insert 0, 2 or 3 more arguments. 97 void passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes );97 std::list< Expression *>::iterator passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes ); 98 98 /// passes extra type parameters into a polymorphic function application 99 99 /// Returns an iterator to the first argument after the added … … 531 531 } 532 532 533 void Pass1::passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes ) {533 std::list< Expression *>::iterator Pass1::passArgTypeVars( ApplicationExpr *appExpr, Type *parmType, Type *argBaseType, std::list< Expression *>::iterator arg, const TyVarMap &exprTyVars, std::set< std::string > &seenTypes ) { 534 534 Type *polyType = isPolyType( parmType, exprTyVars ); 535 535 if ( polyType && ! dynamic_cast< TypeInstType* >( polyType ) ) { 536 536 std::string typeName = mangleType( polyType ); 537 if ( seenTypes.count( typeName ) ) return ;537 if ( seenTypes.count( typeName ) ) return arg; 538 538 539 539 arg = appExpr->get_args().insert( arg, new SizeofExpr( argBaseType->clone() ) ); … … 555 555 seenTypes.insert( typeName ); 556 556 } 557 return arg; 557 558 } 558 559 … … 593 594 if ( polyRetType ) { 594 595 Type *concRetType = replaceWithConcrete( polyRetType, env ); 595 passArgTypeVars( appExpr, polyRetType, concRetType, arg, exprTyVars, seenTypes );596 arg = passArgTypeVars( appExpr, polyRetType, concRetType, arg, exprTyVars, seenTypes ); 596 597 // Skip the return parameter in the argument list. 597 598 fnArg = arg + 1; … … 605 606 Type * argType = (*fnArg)->get_result(); 606 607 if ( ! argType ) continue; 607 passArgTypeVars( appExpr, (*fnParm)->get_type(), argType, arg, exprTyVars, seenTypes );608 arg = passArgTypeVars( appExpr, (*fnParm)->get_type(), argType, arg, exprTyVars, seenTypes ); 608 609 } 609 610 return arg;
Note: See TracChangeset
for help on using the changeset viewer.