Skip to content

Commit

Permalink
Added one more check in ReturnExpr when void type is involved.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzweilin committed Nov 19, 2013
1 parent 5ac258b commit 586224d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wx4ed/src/pp4/ast_stmt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ void ReturnStmt::Check() {
if (!given->IsEquivalentTo(expected))
ReportError::ReturnMismatch(this, given, expected);

EmptyExpr *ee = dynamic_cast<EmptyExpr*>(expr);
if (ee != NULL && expected != Type::voidType)
//if (given == Type::errorType)
// ReportError::ReturnMismatch(this, Type::voidType, expected);
ReportError::ReturnMismatch(this, Type::voidType, expected);
}

PrintStmt::PrintStmt(List<Expr*> *a) {
Expand Down

0 comments on commit 586224d

Please sign in to comment.