make tests green again

This commit is contained in:
Ilya Rezvov
2018-02-25 16:12:56 -08:00
parent fdfdd14ace
commit 88696e4666
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -364,7 +364,7 @@ unify (f `Arrow` t) (f' `Arrow` t') = unify' (f `Arrow` reverse t) (reverse f' `
unify' (f `Arrow` (Val v':t)) ((Val v:f') `Arrow` t') =
if v == v'
then unify' (f `Arrow` t) (f' `Arrow` t')
else Debug.trace ("type err " ++ show v' ++ " - " ++ show v) $ throwError TypeMismatch
else throwError TypeMismatch
unify' (f `Arrow` (Var r:t)) ((Val v:f') `Arrow` t') =
let subst = replace (Var r) (Val v) in
unify' (subst f `Arrow` subst t) (f' `Arrow` t')
@@ -433,7 +433,7 @@ isFunctionValid Function {funcType, locals, body} mod@Module {types} =
Right arr ->
if isArrowMatch arr (empty ==> results)
then Valid
else Debug.trace ("fun err " ++ show arr ++ " - " ++ show (empty ==> results)) $ TypeMismatch
else TypeMismatch
functionsShouldBeValid :: Validator
functionsShouldBeValid mod@Module {functions} =