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

GHC ghc-devs at haskell.org
Fri Sep 7 14:41:54 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 gleachkr):

 By "just included", I meant "available in ghci as a package module". I
 hope that's clear enough---I've read the documentation, but I'm not a GHC
 developer, so my usage might be off here.

 The commands in `test-ghci.sh` demonstrate what I take to be the problem.
 Specifically, the command that gives `checkFlag=false` as the value of
 `test` from `Good.hs` is: `echo "test" | $GHC822 --interactive -package-db
 $PKGDB src/Tests/Good.hs`. It seems to generate something like this:

 {{{
   GHC-Repro master ❯ echo "test" | ~/.stack/programs/x86_64-linux/ghc-
 nopie-8.2.2/bin/ghc --interactive -package-db ./.stack-work/install/x86_64
 -linux-nopie/lts-11.15/8.2.2/pkgdb src/Tests/Good.hs
 GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/graham/dotfiles/home/.ghci
 [1 of 1] Compiling Tests.Good       ( src/Tests/Good.hs, interpreted )
 Ok, one module loaded.
   λ ❯ Flag {checkFlag = False}
   λ ❯ Leaving GHCi.
 }}}

 The sticking point is that, as far as I can tell, the reproduction
 requires `Tests.Link` to be available as a package module. I'm not sure of
 the best way to make that happen on your end. I've tried including
 `.stack-work` in the repo, so that you could, after pulling the latest,
 hopefully run something like

 {{{
 echo "test" | /home/simonpj/5builds/ghc-8.2-branch/inplace/bin/ghc-stage2
 --interactive -package-db ./.stack-work/install/x86_64-linux-
 nopie/lts-11.15/8.2.2/pkgdb src/Tests/Good.hs
 }}}

 and get the same result as me.

 However, I'm not sure this will work, so if you have another way of
 including the contents of GHC-Repro as package modules on your end, that
 might be preferable.

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


More information about the ghc-tickets mailing list