Переглянути джерело

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 )