Opened 13 days ago

#14212 new bug

Give better error message with non-supported Backpack/TH use

Reported by: ezyang Owned by:
Priority: normal Milestone:
Component: Template Haskell Version: 8.2.1
Keywords: backpack Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

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@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.)

Change History (0)

Note: See TracTickets for help on using tickets.