Ticket #2188 (closed merge: fixed)

Opened 5 months ago

Last modified 4 months ago

TH scoping problem

Reported by: igloo Assigned to: igloo
Priority: normal Milestone: 6.10 branch
Component: Template Haskell Version: 6.9
Severity: normal Keywords:
Cc: Difficulty: Unknown
Test Case: TH_scope Architecture: Unknown
Operating System: Unknown

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

04/04/08 14:15:16 changed by simonpj

  • owner set to simonpj.

I'm fixing this.

Simon

04/05/08 02:29:03 changed by simonpj

  • owner changed from simonpj to igloo.
  • type changed from bug to merge.

Fixed by

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

Simon

05/02/08 09:09:10 changed by igloo

  • status changed from new to closed.
  • resolution set to fixed.

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