[GHC] #12395: Misleading GHCi errors when package is installed

GHC ghc-devs at haskell.org
Thu Oct 6 19:39:46 UTC 2016


#12395: Misleading GHCi errors when package is installed
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:
       Component:  GHCi              |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11536            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by crockeea):

 @ezyang
 The attached example demonstrates the problem:

 {{{
 > stack test b
 <completes successfully>

 > stack exec ghci -- b/Main.hs
 b/Main.hs:6:14: error:
     Ambiguous occurrence ‘str’
     It could refer to either ‘A.str’,
                              imported from ‘A’ at b/Main.hs:2:1-8
                              (and originally defined at a/A.hs:7:1-3)
                           or ‘B.str’,
                              imported from ‘B’ at b/Main.hs:3:1-8
                              (and originally defined in ‘A’)
 Failed, modules loaded: A.
 }}}

 The issue may be related to my .ghci file: I have `:set -ia`, but do not
 give a path to `b`. If I give paths to `a` and `b`, or neither, it appears
 to compile fine. Thanks for looking into this!

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12395#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list