Skip to content

False positive (and possibly negative) with top level pattern matching #92

@amesgen

Description

@amesgen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions