[GHC] #14574: Template Haskell Uniq ~ Int leads to external interpreter cross compilation trouble

GHC ghc-devs at haskell.org
Wed Dec 13 11:52:14 UTC 2017


#14574: Template Haskell Uniq ~ Int leads to external interpreter cross compilation
trouble
-------------------------------------+-------------------------------------
        Reporter:  luite             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by luite):

 Replying to [comment:1 RyanGlScott]:

 > Do you mean "things go wrong" when trying to build a program that uses
 Template Haskell? And if so, do you have an example demonstrating what
 goes wrong?

 Yes, when building a program that uses Template Haskell, GHC complains
 that a name is not in scope, when the real reason is that the `Unique` has
 been truncated (when using a 64 bit GHC)

 The following test case was reported on the GHCJS tracker as giving a "not
 in scope" error with 64 bit GHCJS, but working ok with 32 bit GHCJS (
 https://github.com/ghcjs/ghcjs/issues/617 ):

 {{{#!hs
 {-# LANGUAGE OverloadedStrings  #-}
 {-# LANGUAGE QuasiQuotes        #-}
 module QQBug (
       test
     ) where

 import qualified NeatInterpolation
 import Data.Text

 -- txt = "test1"

 test :: Text
 test = [NeatInterpolation.text|$txt|]
     where
       txt = "test"
 }}}

 {{{
 QQBug.hs:13:8: error:
     • The exact Name ‘txt_XN’ is not in scope
         Probable cause: you used a unique Template Haskell name (NameU),
         perhaps via newName, but did not bind it
         If that's it, then -ddump-splices might be useful
     • In the quasi-quotation: [NeatInterpolation.text|$txt|]
 }}}

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


More information about the ghc-tickets mailing list