tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
956 stars 83 forks source link

Type applications in patterns are unsupported #930

Closed amesgen closed 1 year ago

amesgen commented 1 year ago

Describe the bug

Type applications in patterns are new in GHC 9.2, but unsupported in Ormolu.

test :: Foo -> String
test x = case x of
  Foo @t -> show @t 0
ormolu: not implemented yet: Unexpected types in constructor pattern
CallStack (from HasCallStack):
  error, called at src/Ormolu/Utils.hs:59:22 in ormolu-0.5.0.1-FGBbqTWWbSFEfa5RaRk6qU:Ormolu.Utils

Expected behavior We should support this, see https://github.com/tweag/ormolu/blob/8aef990d6c5d3715834de1cbc9a708691c53c6d9/src/Ormolu/Printer/Meat/Declaration/Value.hs#L1041

Environment

Additional context Thanks to @googleson78 for bringing this to my attention!