[GHC] #14885: TH breaks the scoping of quoted default method implementations when spliced

GHC ghc-devs at haskell.org
Sat Mar 3 16:39:19 UTC 2018


#14885: TH breaks the scoping of quoted default method implementations when spliced
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Strangely, one thing that is //not// broken is good ol' top-level type
 signatures. This works just fine:

 {{{#!hs
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TemplateHaskell #-}
 {-# OPTIONS_GHC -ddump-splices #-}
 module Bug where

 f1 :: forall a. a -> a
 f1 x = (x :: a)

 $([d| f2 :: forall a. a -> a
       f2 x = (x :: a) |])
 }}}

 In that case, what secret sauce do top-level functions have that
 `InstanceSigs` //et al.// do not have?

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


More information about the ghc-tickets mailing list