Changeset 07516b56


Ignore:
Timestamp:
Aug 25, 2017, 11:27:56 AM (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:
6ccfb7f
Parents:
19a9822
git-author:
Rob Schluntz <rschlunt@…> (08/25/17 11:27:49)
git-committer:
Rob Schluntz <rschlunt@…> (08/25/17 11:27:56)
Message:

Set result type of statement expressions to void when body is empty or last statement is untyped [fixes #32]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r19a9822 r07516b56  
    645645                }
    646646        }
     647        // ensure that StmtExpr has a result type
     648        if ( ! result ) {
     649                set_result( new VoidType( Type::Qualifiers() ) );
     650        }
    647651}
    648652StmtExpr::StmtExpr( const StmtExpr &other ) : Expression( other ), statements( other.statements->clone() ) {
Note: See TracChangeset for help on using the changeset viewer.