Changeset 07516b56 for src


Ignore:
Timestamp:
Aug 25, 2017, 11:27:56 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, 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.