Changeset 33a7b6d for src/ResolvExpr


Ignore:
Timestamp:
Nov 15, 2016, 5:30:52 PM (8 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:
d9fa60a
Parents:
8f9cc50
Message:

changed use of formal types to actual types for boxing return parameters and passing type variables, fix bug where generic struct's members would change types when a member is accessed on a concrete instantiation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r8f9cc50 r33a7b6d  
    218218                std::list< Declaration* > members;
    219219                aggInst->lookup( name, members );
     220                TypeSubstitution sub = TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->get_parameters().begin() );
    220221                for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
    221222                        if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) {
    222                                 alternatives.push_back( Alternative( new MemberExpr( dwt, expr->clone() ), env, newCost ) );
     223                                MemberExpr * memExpr = new MemberExpr( dwt, expr->clone() );
     224                                sub.apply( memExpr );
     225                                alternatives.push_back( Alternative( memExpr, env, newCost ) );
    223226                                renameTypes( alternatives.back().expr );
    224227                        } else {
     
    800803                AlternativeFinder funcFinder( indexer, env );
    801804                funcFinder.findWithAdjustment( memberExpr->get_aggregate() );
    802 
    803805                for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) {
    804806                        if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_result() ) ) {
Note: See TracChangeset for help on using the changeset viewer.