[GHC] #10743: Data declaration order matters to compiler.

GHC ghc-devs at haskell.org
Thu Aug 6 03:27:42 UTC 2015


#10743: Data declaration order matters to compiler.
-------------------------------------+-------------------------------------
              Reporter:              |             Owner:
  thomaseding                        |
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.8.3
              Keywords:              |  Operating System:  Windows
          Architecture:              |   Type of failure:  GHC rejects
  Unknown/Multiple                   |  valid program
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:
Differential Revisions:              |
-------------------------------------+-------------------------------------
 {{{

 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE TemplateHaskell #-}

 import Control.Lens.TH (makeLenses)

 data Handle h where
     PlayerHandle :: Int -> Handle Player

     -- GHC 7.8.3 complains that NonPlayer is not in scope
     NonPlayerHandle :: Int -> Handle NonPlayer

 data Player = Player

 -- Deferring this until after NonPlayer is defined, resolves the compile
 error.
 -- Commenting this out also works.
 makeLenses ''Player

 data NonPlayer

 }}}

 (The exact version of 'lens' I have tried this with is 'lens-4.7' if that
 matters.)

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


More information about the ghc-tickets mailing list