Small fix in morphBind

This commit is contained in:
Rakarake 2023-05-01 11:57:06 +02:00
parent 0af2aac61e
commit 3377879dd0

View file

@ -150,7 +150,10 @@ getMonoFromPoly t = do
Returns the annotated bind name.
-}
morphBind :: M.Type -> T.Bind -> EnvM Ident
morphBind expectedType b@(T.Bind (ident, btype) args (exp, expt)) =
morphBind expectedType b@(T.Bind (ident, btype) args (exp, expt)) = do
-- The "new name" is used to find out if it is already marked or not.
let name' = newFuncName expectedType b
bindMarked <- isBindMarked (coerce name')
local
( \env ->
env
@ -159,9 +162,6 @@ morphBind expectedType b@(T.Bind (ident, btype) args (exp, expt)) =
}
)
$ do
-- The "new name" is used to find out if it is already marked or not.
let name' = newFuncName expectedType b
bindMarked <- isBindMarked (coerce name')
-- Return with right name if already marked
if bindMarked
then return name'