In the following situation, xxx is marked as unused, even though it is not:
Dep.hs:
module Dep (a, b) where
xxx :: Int
xxx = 3
a, b :: Int
(a, b) = (xxx, 1)
Main.hs:
module Main where
import Dep
main :: IO ()
main = print a
Minimal reproducible example:
$ git clone --branch weeder-pattern-bug --single-branch https://github.com/amesgen/stuff
$ cd stuff
$ weeder --version
weeder version 2.3.0
hie version 9001
$ cabal build
$ weeder
app/Dep.hs:4: xxx
Also, b in Dep.hs is not marked as unused, but I am not sure if this is intentional.