Ignore:
Timestamp:
Jul 17, 2017, 3:25:58 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
795d450
Parents:
7ebaa56
Message:

Fix TupleAssignment? code for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r7ebaa56 re6cee92  
    815815
    816816        Expression * restructureCast( Expression * argExpr, Type * toType ) {
    817                 if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() ) {
    818                         // Argument expression is a tuple and the target type is not void. Cast each member of the tuple
    819                         // to its corresponding target type, producing the tuple of those cast expressions. If there are
    820                         // more components of the tuple than components in the target type, then excess components do not
    821                         // come out in the result expression (but UniqueExprs ensure that side effects will still be done).
     817                if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() && ! dynamic_cast<ReferenceType *>( toType ) ) {
     818                        // Argument expression is a tuple and the target type is not void and not a reference type.
     819                        // Cast each member of the tuple to its corresponding target type, producing the tuple of those
     820                        // cast expressions. If there are more components of the tuple than components in the target type,
     821                        // then excess components do not come out in the result expression (but UniqueExprs ensure that
     822                        // side effects will still be done).
    822823                        if ( Tuples::maybeImpure( argExpr ) && ! dynamic_cast< UniqueExpr * >( argExpr ) ) {
    823824                                // expressions which may contain side effects require a single unique instance of the expression.
Note: See TracChangeset for help on using the changeset viewer.