id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
2018,Interface file error with GADT and -O1,Ashley Yakeley,igloo,"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
}}}",merge,closed,normal,,Compiler,6.8.2,fixed,,,Linux,x86_64 (amd64),,Unknown,tc241,,,
