handle more parsing edgecases

This commit is contained in:
Ilya Rezvov
2021-04-07 10:35:51 -07:00
parent 93a79badbe
commit fa1d9a7bd1
3 changed files with 78 additions and 42 deletions
+1 -1
View File
@@ -210,7 +210,7 @@ getInstrType Block { blockType, body } = do
getInstrType Loop { blockType, body } = do
bt@(Arrow from _) <- getBlockType blockType
resultType <- getResultType blockType
t <- withLabel [] $ getExpressionTypeWithInput from body
t <- withLabel (map (\(Val v) -> v) from) $ getExpressionTypeWithInput from body
if isArrowMatch t bt
then return bt
else throwError $ TypeMismatch t bt