소스 검색

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 )