Skip to content

Commit

Permalink
Fix infinite recursion when walking Abstractions
Browse files Browse the repository at this point in the history
This caused an infinite recursion when trying to minimise the
non-idempotency when running --verify on

    {
      foo
    # bar
    , baz # qux
    }:
    null
  • Loading branch information
infinisil committed Jul 11, 2024
1 parent a98ea65 commit e838fd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Nixfmt/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ instance LanguageElement Expression where
)
(Assert _ cond _ body) -> [cond, body]
(If _ expr0 _ expr1 _ expr2) -> [expr0, expr1, expr2]
(Abstraction param _ body) -> [Abstraction param (ann TColon) (Term (Token (ann (Identifier "_")))), body]
(Abstraction param _ body) -> walkSubprograms param ++ [body]
(Application g a) -> [g, a]
(Operation left _ right) -> [left, right]
(MemberCheck name _ sels) -> name : (sels >>= walkSubprograms)
Expand Down

0 comments on commit e838fd5

Please sign in to comment.