Ticket #2024 (closed merge: fixed)
Template Haskell doesn't work well with Lexically Scoped Type Variables
Description
I don't know if TH is meant to work properly with LSTV. I don't personally need it and I run into this bug by chance, but at least I think that the error should be friendlier in any case. See this (pretty stupid, sorry) example.
Foo.hs
{-# LANGUAGE TemplateHaskell, ScopedTypeVariables #-}
module Foo where
myid :: forall a . a -> a
myid = $([| (\x -> x) :: (a -> a) |])
Ghci shows this user-unfriendly error:
$ ghci Foo.hs
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
[1 of 1] Compiling Foo ( Foo.hs, interpreted )
Foo.hs:6:12:
DsMeta: failed binder lookup when desugaring a TH bracket: a
Failed, modules loaded: none.
Prelude>
Change History
Note: See
TracTickets for help on using
tickets.
