Skip to content

Commit

Permalink
fix Internal-to-Core
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Mar 9, 2023
1 parent 339d91a commit a2be800
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Juvix/Compiler/Core/Translation/FromInternal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,9 @@ fromPatternArg pa = case pa ^. Internal.patternArgName of
_ -> return ()
return $ PatWildcard (PatternWildcard mempty (Binder (n ^. nameText) (Just (n ^. nameLoc)) ty))
Internal.PatternConstructorApp c -> do
varsNum <- (^. indexTableVarsNum) <$> get
idt :: IndexTable <- get
ctorTy <- runReader idt $ goType (fromJust (c ^. Internal.constrAppType))
let varsNum = idt ^. indexTableVarsNum
case asPat of
Just (pan, _) -> modify (over indexTableVars (HashMap.insert (pan ^. nameId) varsNum))
_ -> return ()
Expand All @@ -665,7 +667,6 @@ fromPatternArg pa = case pa ^. Internal.patternArgName of
let indArgs = replicate nParams (wildcard mkSmallUniv)
args = indArgs ++ patternArgs
m <- getIdent identIndex
ctorTy <- goType (fromJust (c ^. Internal.constrAppType))
case m of
Just (IdentConstr tag) ->
return $
Expand Down

0 comments on commit a2be800

Please sign in to comment.