[GHC] #11824: GHC error in desugarer lookup

GHC ghc-devs at haskell.org
Wed Apr 13 08:23:09 UTC 2016


#11824: GHC error in desugarer lookup
-------------------------------------+-------------------------------------
        Reporter:  darchon           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  8.0.1-rc3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by darchon):

 I wanted to report a separate (but perhaps related) error. When I change

 Unbound/Generics/LocallyNameless.hs to

 {{{#!hs
 module Unbound.Generics.LocallyNameless where

 import Data.Typeable (Typeable)

 data Name a = Name

 class Alpha a where
   isTerm :: a -> Bool

 instance Alpha (Name a) where
   isTerm _ = False
 }}}

 and CLaSH/Core/Type.hs to

 {{{#!hs
 module CLaSH.Core.Type where

 import Unbound.Generics.LocallyNameless (Alpha (..),Name)
 import CLaSH.Core.TyCon

 data Type = VarTy

 type TyName = Name Type

 instance Alpha Type where
   isTerm Foo = False
 }}}

 I get:

 {{{
 ~/devel/IfaceError(master *) $ ghci CLaSH/Core/Type.hs
 GHCi, version 8.1.20160412: http://www.haskell.org/ghc/  :? for help
 [1 of 4] Compiling Unbound.Generics.LocallyNameless (
 Unbound/Generics/LocallyNameless.hs, interpreted )
 [2 of 4] Compiling CLaSH.Core.Type[boot] ( CLaSH/Core/Type.hs-boot,
 interpreted )
 [3 of 4] Compiling CLaSH.Core.TyCon ( CLaSH/Core/TyCon.hs, interpreted )
 [4 of 4] Compiling CLaSH.Core.Type  ( CLaSH/Core/Type.hs, interpreted )

 CLaSH/Core/Type.hs:11:10: error:
     Not in scope: data constructor ‘Foo’
 *** Exception: expectJust showModule
 CallStack (from HasCallStack):
   error, called at compiler/utils/Maybes.hs:47:27 in ghc:Maybes
 }}}

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


More information about the ghc-tickets mailing list