Skip to content

Commit

Permalink
Apply same alternative formatting for match expression as in if expre…
Browse files Browse the repository at this point in the history
…ssions. Fixes fsprojects#1774.
  • Loading branch information
nojaf committed Jul 5, 2021
1 parent 7f3731b commit dce1259
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 142 deletions.
27 changes: 26 additions & 1 deletion src/Fantomas.Tests/PatternMatchingTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ let MethInfoIsUnseen g m ty minfo =
#else
(fun _provAttribs -> None)
#endif
with
with
| Some res -> res
| None -> false
Expand Down Expand Up @@ -1888,3 +1888,28 @@ let select p =
|> List.singleton
|> instruction "s"
"""

[<Test>]
let ``multiline infix expression in match, 1774`` () =
formatSourceString
false
"""
match structuralTypes |> List.tryFind (fst >> checkIfFieldTypeSupportsComparison tycon >> not) with
| _ -> ()
"""
config
|> prepend newline
|> should
equal
"""
match
structuralTypes
|> List.tryFind
(
fst
>> checkIfFieldTypeSupportsComparison tycon
>> not
)
with
| _ -> ()
"""

0 comments on commit dce1259

Please sign in to comment.