Skip to content

regression in -Wunused-pattern-binds

{-# LANGUAGE TemplateHaskell #-}
module TTT where

a :: ()
a = let () = () in ()

b :: ()
b = let $([p|()|]) = () in ()

on ghc-9.2.2 this produces the warnings:

[nix-shell:~/ghc-clean]$ ghc TTT.hs -Wall -fforce-recomp
[1 of 1] Compiling TTT              ( TTT.hs, TTT.o, TTT.dyn_o )

TTT.hs:5:9: warning: [-Wunused-pattern-binds]
    This pattern-binding binds no variables: () = ()
  |
5 | a = let () = () in ()
  |         ^^^^^^^

TTT.hs:8:9: warning: [-Wunused-pattern-binds]
    This pattern-binding binds no variables: (()) = ()
  |
8 | b = let $([p|()|]) = () in ()
  |         ^^^^^^^^^^^^^^^

But on HEAD we only get the first warning. I have a fix.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information