Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2188 closed merge (fixed)

TH scoping problem

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

Description

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.

Change History (5)

comment:1 Changed 9 years ago by simonpj

Owner: set to simonpj

I'm fixing this.

Simon

comment:2 Changed 9 years ago by simonpj

Owner: changed from simonpj to igloo
Type: bugmerge

Fixed by

Fri Apr  4 13:55:56 PDT 2008  simonpj@microsoft.com
  * Fix Trac #2188: scoping in TH declarations quotes

Simon

comment:3 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed

The 6.8 branch is already OK, so closing this bug.

comment:4 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:5 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.