Opened 4 years ago

#57 assigned defect

UniqueExprs with same ID are resolved independently

Reported by: Rob Schluntz Owned by: Rob Schluntz
Priority: minor Component: cfa-cc
Version: 1.0 Keywords: Tuple multiple assignment
Cc:

Description

struct inner {
    int size;
};

struct outer {
    inner;
    int func;
};

int main() {
    outer o;
    o.[size, func];
}

Here, the aggregate portion of the tuple member expression is wrapped in a UniqueExpr so that the expression is only evaluated once, and rewritten as [UniqueExpr?(o).size, UniqueExpr?(o).func].

Currently, these UniqueExprs are resolved independently, so in this case the first becomes UniqueExpr(o.anon).size and the second becomes UniqueExpr(o).func. This approach needs to be modified so that all UniqueExprs with the same ID resolve to the same expression, and that resolution needs to take into account the context for all instances of the expression.

Change History (0)

Note: See TracTickets for help on using tickets.