[GHC] #16076: Internal compiler error when instance uses FFI function and defining other instance of the same class through Template Haskell

GHC ghc-devs at haskell.org
Thu Dec 20 18:31:40 UTC 2018


#16076: Internal compiler error when instance uses FFI function and defining other
instance of the same class through Template Haskell
-------------------------------------+-------------------------------------
        Reporter:  radekchannable    |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.4.4
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by quasicomputational):

 I think the primary problem here is the error message.

 To run the TH code, GHC is trying to call the `showFoo` symbol that you've
 promised exists (with the FFI declaration) and, as it doesn't actually
 exist, it's failing to do so. That's manifesting as the GHCi linker error
 you're seeing.

 I've got confused and gone on a minor wild goose chase for a GHC bug
 because of this message myself. I wonder if the linker can be improved and
 give a better error here...

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


More information about the ghc-tickets mailing list