[GHC] #15599: typeclass inference depends on whether a module is exposed.

GHC ghc-devs at haskell.org
Thu Sep 6 09:16:45 UTC 2018


#15599: typeclass inference depends on whether a module is exposed.
-------------------------------------+-------------------------------------
        Reporter:  gleachkr          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.3
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 What's the `-package-db` stuff?  I tried this
 {{{
 #!/bin/bash
 GHCI822="/home/simonpj/5builds/ghc-8.2-branch/inplace/bin/ghc-stage2
 --interactive"
 GHCI843="/home/simonpj/5builds/ghc-8.4-branch/inplace/bin/ghc-stage2
 --interactive"

 echo "Behavior in 8.2.2 with pkgdb"
 echo "test" | $GHCI822  Good.hs  2> /dev/null | grep checkFlag
 echo "Behavior in 8.2.2 without pkgdb"
 echo "test" | $GHCI822 Good.hs Link.hs 2> /dev/null | grep checkFlag
 echo "Behavior in 8.4.3 with pkgdb"
 echo "test" | $GHCI843 Good.hs 2> /dev/null | grep checkFlag
 echo "Behavior in 8.4.3 without pkgdb"
 echo "test" | $GHCI843 Good.hs Link.hs 2> /dev/null | grep checkFlag
 }}}
 and got
 {{{
 simonpj at cam-05-unx:~/tmp/T15599$ ./test-ghci.sh
 Behavior in 8.2.2 with pkgdb
 *Good> Flag {checkFlag = True}
 Behavior in 8.2.2 without pkgdb
 *Good> Flag {checkFlag = True}
 Behavior in 8.4.3 with pkgdb
 *Good> Flag {checkFlag = True}
 Behavior in 8.4.3 without pkgdb
 *Good> Flag {checkFlag = True}
 }}}
 This is with all the files in the same directory.  With your file
 structure (source files nested inside `src/Tests`), the first command
 fails with
 {{{
 Behavior in 8.2.2 with pkgdb
 GHCi, version 8.2.2.20180313: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Tests.Good       ( src/Tests/Good.hs, interpreted )

 src/Tests/Good.hs:3:1: error:
     Could not find module ‘Tests.Link’
     Use -v to see a list of the files searched for.
   |
 3 | import Tests.Link
   | ^^^^^^^^^^^^^^^^^
 Failed, no modules loaded.
 }}}
 Clearly I don't understand your use of package databases here

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


More information about the ghc-tickets mailing list