#2018: Interface file error with GADT and -O1
-------------------------------+--------------------------------------------
    Reporter:  Ashley Yakeley  |       Owner:       
        Type:  bug             |      Status:  new  
    Priority:  normal          |   Milestone:       
   Component:  Compiler        |     Version:  6.8.2
    Severity:  normal          |    Keywords:       
  Difficulty:  Unknown         |    Testcase:       
Architecture:  x86_64 (amd64)  |          Os:  Linux
-------------------------------+--------------------------------------------
 I've tried to simplify this as much as possible. In particular, the bug
 goes away if -O1 is removed.

 {{{
 module Bug1 where

 data A a where
   MkA :: A ()

 class C w where
   f :: forall a . w a -> Maybe a

 instance C A where
   f MkA  = Just ()
 }}}

 {{{
 module Bug2 where
 import Bug1

 f' :: A a -> Maybe a
 f' = f
 }}}

 Run with this:

 {{{
 #!/bin/sh
 rm -f *.hi *.o
 ghc --version
 ghc -c -XGADTs -XRankNTypes -O1 Bug1.hs
 ghc -c -XGADTs -XRankNTypes -O1 Bug2.hs
 }}}

 This is the result I get:

 {{{
 The Glorious Glasgow Haskell Compilation System, version 6.8.2
 Bug1.hi
 Declaration for a:
   Iface type variable out of scope:  a
 Cannot continue after interface file error
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2018>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to