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

GHC ghc-devs at haskell.org
Thu Apr 19 19:25:43 UTC 2018


#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 <ben@…>):

 In [changeset:"b08a6d75e0440f33260bea5319b8c3f871b42f6e/ghc"
 b08a6d75/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="b08a6d75e0440f33260bea5319b8c3f871b42f6e"
 Fix #15012 with a well-placed use of Any

 Previously, derived `Generic1` instances could have associated `Rep1`
 type family instances with unbound variables, such as in the following
 example:

 ```lang=haskell
 data T a = MkT (FakeOut a) deriving Generic1
 type FakeOut a = Int

 ==>

 instance Generic1 T where
   type Rep1 T = ... (Rec0 (FakeOut a))
 ```

 Yikes! To avoid this, we simply map the last type variable in a
 derived `Generic1` instance to `Any`.

 Test Plan: make test TEST=T15012

 Reviewers: bgamari

 Reviewed By: bgamari

 Subscribers: simonpj, thomie, carter

 GHC Trac Issues: #15012

 Differential Revision: https://phabricator.haskell.org/D4602
 }}}

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


More information about the ghc-tickets mailing list