Browse Source

Functions should return values. Fixes #322

woollybah 7 years ago
parent
commit
f4bcc4cc93
1 changed files with 1 additions and 0 deletions
  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 )