Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

[IMRF-50] Symbol imported from both qualified and non-qualified namespaces is not considered unused #47

Open
chshersh opened this issue Aug 11, 2017 · 0 comments

Comments

@chshersh
Copy link
Contributor

Consider next imports:

import           Language.Haskell.Names (symbolName)
import qualified Language.Haskell.Names as N

GHC prints warning:

    The import of ‘N.Symbol(symbolName)’
    from module ‘Language.Haskell.Names’ is redundant

if only N.symbolName is used in this module. And importify doesn't remove such redundant import. Though, resolution of this bug is ambiguous.

Alexander Sukhoverkhov [22:07]
Ok, the symbol needs to be imported both qualified and unqualified but used qualified. Then GHC displays warning on the unqualified import but Importify doesn't remove either. (edited)

Dmitry Kovanikov [22:25]
@a.sukhoverkhov Yes, it's a warning. But we have two possibilities what to do next:

  1. Remove symbolName from imports
  2. Turn all usages of N.symbolName into symbolName .
    And in this exact module I want to perform second option. But importify is way too far from modifying not only import section 😞
    Even if importify can, it's not obvious which behavior shoud it choose by default. So just postpone to better time.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant