[GHC] #15012: "Iface type variable out of scope" when compiling with -c

#15012: "Iface type variable out of scope" when compiling with -c -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Take these two files: {{{#!hs {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TypeFamilies #-} module Foo where import GHC.Generics type FakeOut a = Int data family TyFamily y z data instance TyFamily a b = TyFamily Int (FakeOut b) deriving Generic1 }}} {{{#!hs module Bar where import Foo import GHC.Generics main :: IO () main = print $ from1 $ TyFamily 1 2 }}} And compile them like so: {{{ $ ghc -c Foo.hs $ ghc -c Bar.hs ./Foo.hi Declaration for Rep1_R:TyFamilyab Axiom branches Rep1_R:TyFamilyab: Iface type variable out of scope: b Cannot continue after interface file error }}} I can reproduce this with every version of GHC from 7.8.4 onward, so this is quite an old bug! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15012 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15012: "Iface type variable out of scope" when compiling with -c -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: deriving Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => deriving Comment: I suspect that `DeriveGeneric` is to blame here. Here is what `-ddump- deriv` tells us about the derived `Rep1` associated type family instance for `Generic1`: {{{#!hs Derived type family instances: type GHC.Generics.Rep1 (Foo.TyFamily a_a2ta) = GHC.Generics.D1 ('GHC.Generics.MetaData "TyFamily" "Foo" "main" 'GHC.Types.False) (GHC.Generics.C1 ('GHC.Generics.MetaCons "TyFamily" 'GHC.Generics.PrefixI 'GHC.Types.False) (GHC.Generics.S1 ('GHC.Generics.MetaSel 'GHC.Base.Nothing 'GHC.Generics.NoSourceUnpackedness 'GHC.Generics.NoSourceStrictness 'GHC.Generics.DecidedLazy) (GHC.Generics.Rec0 GHC.Types.Int) GHC.Generics.:*: GHC.Generics.S1 ('GHC.Generics.MetaSel 'GHC.Base.Nothing 'GHC.Generics.NoSourceUnpackedness 'GHC.Generics.NoSourceStrictness 'GHC.Generics.DecidedLazy) (GHC.Generics.Rec0 (Foo.FakeOut b_a2q1)))) }}} Notice that `b_a2q1` is unbound in this definition! Perhaps we should be turning this into `Any`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15012#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15012: "Iface type variable out of scope" when compiling with -c -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: deriving Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4602 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4602 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15012#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15012: "Iface type variable out of scope" when compiling with -c -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Resolution: | Keywords: deriving Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4602 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): I added a suggestion on the Phab, but it is (still, alas) not broadcast. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15012#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15012: "Iface type variable out of scope" when compiling with -c
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.1
Resolution: | Keywords: deriving
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4602
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#15012: "Iface type variable out of scope" when compiling with -c -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 Resolution: fixed | Keywords: deriving Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4602 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15012#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15012: "Iface type variable out of scope" when compiling with -c
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.4.1
Resolution: fixed | Keywords: deriving
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4602
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC