Skip to content

Duplicate entries in -ddump-minimal-imports

Consider

module Foo where

import System.IO

f = [ReadMode, ReadMode]

We get this:

$ ghc -c -ddump-minimal-imports Foo.hs
$ cat Foo.imports
import System.IO ( IOMode(ReadMode, ReadMode) )

Notice that ReadMode appears twice.

Turns out this is because of a refactoring in RnNames

commit 6353efc7694ba8ec86c091918e02595662169ae2
Author: David Eichmann <EichmannD@gmail.com>
Date:   Thu Nov 22 14:48:05 2018 -0500

    Fix unused-import warnings
    
    This patch fixes a fairly long-standing bug (dating back to 2015) in
    RdrName.bestImport, namely

(which I wrote -- don't blame David!).

Trac metadata
Trac field Value
Version 8.6.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information