Changeset a2a85658


Ignore:
Timestamp:
Jun 18, 2019, 2:28:36 PM (2 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
4487667, 73edfe9
Parents:
c8e4d2f8
Message:

Fixed conversion of tuple assignments to reuse the common part correctly. For example, in [x,y] = foo().[a,b], foo should be called once. Convert-convert before resolve was causing foo to be called twice, because the unique ID of a UniqueExpr? wasn't preserved on AST conversion. Symptom was failing test tuple/tupleMember (given convert-convert before resolve).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    rc8e4d2f8 ra2a85658  
    993993        const ast::Expr * visit( const ast::UniqueExpr * node ) override final {
    994994                auto rslt = new UniqueExpr(
    995                         get<Expression>().accept1(node->expr)
     995                        get<Expression>().accept1(node->expr),
     996                        node->id
    996997                );
    997998
     
    23672368                auto rslt = new ast::UniqueExpr(
    23682369                        old->location,
    2369                         GET_ACCEPT_1(expr, Expr)
     2370                        GET_ACCEPT_1(expr, Expr),
     2371                        old->get_id()
    23702372                );
    23712373                rslt->object = GET_ACCEPT_1(object, ObjectDecl);
Note: See TracChangeset for help on using the changeset viewer.