Skip to content

Commit

Permalink
Fix runtime exception if we cannot find arity of a function call cycle.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinheghan committed Dec 9, 2024
1 parent 3de0d46 commit 512cdd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/src/Generate/JavaScript.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ makeArgLookup graph home name =
Just arity
Just (Opt.Link global) ->
case Map.lookup global graph of
Just (Opt.Cycle names _ defs _) ->
Just (Opt.Cycle _ _ defs _) ->
case List.find (\d -> defName d == name) defs of
Just (Opt.Def _ _ (Opt.Function _ args _)) ->
Just (length args)
Just (Opt.TailDef _ _ args _) ->
Just (length args)
_ ->
error (show names)
Nothing
_ ->
Nothing
_ ->
Expand Down

0 comments on commit 512cdd8

Please sign in to comment.