[GHC] #14212: Give better error message with non-supported Backpack/TH use

GHC ghc-devs at haskell.org
Sun Sep 10 02:38:38 UTC 2017


#14212: Give better error message with non-supported Backpack/TH use
-------------------------------------+-------------------------------------
           Reporter:  ezyang         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Template       |           Version:  8.2.1
  Haskell                            |
           Keywords:  backpack       |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This is something of a follow up to #13268.

 Suppose you have an indefinite package. If you use TemplateHaskell with a
 splice that was defined in the indefinite package itself, there is no
 reasonable way to expect this to work, since in general you can't have
 compiled the the imported module before you need to run the splice (and
 the splice needs to be run before you know how the holes are
 instantiated.)

 But say you try and do it anyway. GHC will give an error like this:

 {{{
 ghc: ^^ Could not load
 'qzm0zi1zminplacezmENEL5G3hx7IK2t0f6HloyH_A_f_closure', dependency
 unresolved. See top entry above.


 ByteCodeLink.lookupCE
 During interactive linking, GHCi couldn't find the following symbol:
   qzm0zi1zminplacezmENEL5G3hx7IK2t0f6HloyH_A_f_closure
 This may be due to you not asking GHCi to load extra object files,
 archives or DLLs needed by your current session.  Restart GHCi, specifying
 the missing library using the -L/path/to/object/dir and -lmissinglibname
 flags, or simply by naming the relevant files on the GHCi command line.
 Alternatively, this link failure might indicate a bug in GHCi.
 If you suspect the latter, please send a bug report to:
   glasgow-haskell-bugs at haskell.org
 }}}

 This is not a good error message. A good error message would be to say
 that you can't use in a splice a function defined in an indefinite package
 (as per the current library.)

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


More information about the ghc-tickets mailing list