Skip to content

TH scoping problem

In the HEAD, these modules:

module TH_scope where

import TH_scope_helper

x :: ()
x = ()
    where hold = $( wibble [d| hold :: ()
                               hold = () |] )
module TH_scope_helper where

import Language.Haskell.TH

wibble :: Q [Dec] -> Q Exp
wibble _ = [| 'a' |]

give:

TH_scope.hs:8:31:
    Misplaced type signature: hold :: ()
    The type signature must be given where `hold' is declared

Renaming the outer hold fixes it.

The 6.8 branch seems OK.

Trac metadata
Trac field Value
Version 6.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information