Skip to content

Commit

Permalink
fix(type-infer): Fix constructor pattern arguments being reversed in …
Browse files Browse the repository at this point in the history
…type inference
  • Loading branch information
bristermitten committed May 24, 2024
1 parent 936ab2a commit 321fdd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Elara/TypeInfer/Infer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ inferPattern (Syntax.Pattern (Located location e0, _)) = case e0 of
-- fold over the application with inferPatternApplication
-- for example, given Ctor a b where Ctor : a -> b -> Type a b
-- we infer it as (Ctor a) b
let run t [] acc = pure (t, acc)
let run t [] acc = pure (t, reverse acc) -- reverse because we fold from the right
run t (arg : args) acc = do
(pat, t) <- inferPatternApplication t arg
run t args (pat : acc)
Expand Down

0 comments on commit 321fdd6

Please sign in to comment.