Commit 0b2702b3 authored by André Pacak's avatar André Pacak

fix copy paste error

parent d93f4fe9
...@@ -146,7 +146,8 @@ lookup tymap t x = case parent t of ...@@ -146,7 +146,8 @@ lookup tymap t x = case parent t of
if name == x if name == x
then do then do
ty <- requiredType tymap p ty <- requiredType tymap p
(ty1, ty2) <- matchFun ty (show p) rty <- matchTypeVar tymap ty
(ty1, ty2) <- matchFun rty (show p)
return ty1 return ty1
else lookup tymap p x else lookup tymap p x
Just p@(InL term _) -> do Just p@(InL term _) -> do
...@@ -157,14 +158,16 @@ lookup tymap t x = case parent t of ...@@ -157,14 +158,16 @@ lookup tymap t x = case parent t of
if n1 == x if n1 == x
then do then do
ety <- inferType tymap e ety <- inferType tymap e
(ty1, ty2) <- matchSum ety (show e) rty <- matchTypeVar tymap ety
(ty1, ty2) <- matchSum rty (show e)
return ty1 return ty1
else lookup tymap p x else lookup tymap p x
Just p@(Case e n1 t1 n2 t2 _) | t == t2 -> Just p@(Case e n1 t1 n2 t2 _) | t == t2 ->
if n2 == x if n2 == x
then do then do
ety <- inferType tymap e ety <- inferType tymap e
(ty1, ty2) <- matchSum ety (show e) rty <- matchTypeVar tymap ety
(ty1, ty2) <- matchSum rty (show e)
return ty2 return ty2
else lookup tymap p x else lookup tymap p x
Just p@(Tag n t' _) | t == t' -> do Just p@(Tag n t' _) | t == t' -> do
...@@ -173,7 +176,8 @@ lookup tymap t x = case parent t of ...@@ -173,7 +176,8 @@ lookup tymap t x = case parent t of
lookup tymap p x lookup tymap p x
Just p@(Match m cases _) | t /= m -> do Just p@(Match m cases _) | t /= m -> do
ety <- inferType tymap m ety <- inferType tymap m
typeMap <- matchVariant ety (show m) rty <- matchTypeVar tymap ety
typeMap <- matchVariant rty (show m)
let ml = find (\(_, x', t') -> t == t' && x == x') cases let ml = find (\(_, x', t') -> t == t' && x == x') cases
if isJust ml if isJust ml
then do then do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment