浏览代码

Functions should return values. Fixes #322

woollybah 7 年之前
父节点
当前提交
f4bcc4cc93
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      stmt.bmx

+ 1 - 0
stmt.bmx

@@ -255,6 +255,7 @@ Type TReturnStmt Extends TStmt
 				Err errorText
 			End If
 			expr=expr.SemantAndCast( fdecl.retType )
+			If TIdentTypeExpr(expr) Err "Function must return a value."
 		Else If fdecl.IsCtor()
 			expr=New TSelfExpr.Semant()
 		Else If Not TVoidType( fdecl.retType )