Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2018
Closed
Open
Issue created Jan 06, 2008 by Ashley Yakeley@AshleyYakeleyDeveloper

Interface file error with GADT and -O1

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
Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking