Ignore:
Timestamp:
Jul 25, 2022, 3:17:25 PM (3 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
b0d9ff7
Parents:
4e2befe3 (diff), ffec1bf (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into qualifiedEnum

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/SymbolTable.cpp

    r4e2befe3 rdef751f  
    6565
    6666Expr * SymbolTable::IdData::combine( const CodeLocation & loc, ResolvExpr::Cost & cost ) const {
    67         Expr * ret = ( baseExpr ) ?
    68                 (Expr *)new MemberExpr{ loc, id, referenceToRvalueConversion( baseExpr, cost ) } :
    69                 (Expr *)new VariableExpr{ loc, id };
     67        Expr * ret;
     68        if ( baseExpr ) {
     69                if (baseExpr->env) {
     70                        Expr * base = shallowCopy(baseExpr);
     71                        const TypeSubstitution * subs = baseExpr->env;
     72                        base->env = nullptr;
     73                        ret = new MemberExpr{loc, id, referenceToRvalueConversion( base, cost )};
     74                        ret->env = subs;
     75                }
     76                else {
     77                        ret = new MemberExpr{ loc, id, referenceToRvalueConversion( baseExpr, cost ) };
     78                }
     79        }
     80        else {
     81                ret = new VariableExpr{ loc, id };
     82        }
    7083        if ( deleter ) { ret = new DeletedExpr{ loc, ret, deleter }; }
    7184        return ret;
     
    772785                                                && ! dynamic_cast<const UnionInstType *>(rty) ) continue;
    773786                                        ResolvExpr::Cost cost = ResolvExpr::Cost::zero;
     787                                        ast::ptr<ast::TypeSubstitution> tmp = expr->env;
     788                                        expr = mutate_field(expr, &Expr::env, nullptr);
    774789                                        const Expr * base = ResolvExpr::referenceToRvalueConversion( expr, cost );
     790                                        base = mutate_field(base, &Expr::env, tmp);
     791
    775792                                        addMembers(
    776793                                                rty->aggr(), new MemberExpr{ base->location, dwt, base }, handleConflicts );
Note: See TracChangeset for help on using the changeset viewer.