handle functions with empty body

This commit is contained in:
Ilya Rezvov
2018-02-24 21:49:06 -08:00
parent 55215f56de
commit e05bcdd0cb
3 changed files with 24 additions and 12 deletions
+1 -1
View File
@@ -389,7 +389,7 @@ isFunctionValid Function {funcType, locals, body} mod@Module {types} =
let ctx = ctxFromModule (params ++ locals) [r] r mod in
case runChecker ctx $ getExpressionType body of
Left err -> err
Right arr -> if arr == (empty ==> results) then Valid else TypeMismatch
Right arr -> if arr == (empty ==> results) || arr == (Any ==> Any) then Valid else TypeMismatch
functionsShouldBeValid :: Validator
functionsShouldBeValid mod@Module {functions} =