[GHC] #10815: Need more kind inference in associated type instances

GHC ghc-devs at haskell.org
Sat Sep 19 16:08:00 UTC 2015


#10815: Need more kind inference in associated type instances
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                   Owner:  goldfire
            Type:  bug               |                  Status:  patch
        Priority:  normal            |               Milestone:
       Component:  Compiler (Type    |                 Version:  7.10.2
  checker)                           |
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:  Phab:D1195
-------------------------------------+-------------------------------------

Comment (by Richard Eisenberg <eir@…>):

 In [changeset:"2d4db40ac07db2fc776d61aac2383608911281ff/ghc"
 2d4db40a/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="2d4db40ac07db2fc776d61aac2383608911281ff"
 Fix #10815 by kind-checking type patterns against known kinds.

 tcFamTyPats now must take information about the instantiation of any
 class variables, when checking the instance of an associated type.

 Getting this to work out required some unexpected refactoring in
 TcDeriv. TcDeriv needs to look at class instances because of the
 possibility of associated datatypes with `deriving` specs. TcDeriv
 worked over the user-specified instances. But any data family instances
 were already processed, and TcDeriv had no way of finding the rep
 tycons. Indeed, TcDeriv *re-type-checked* any data family instances
 in an attempt to rediscover what GHC already knew. So, this commit
 introduces better tracking of compiled data families between TcInstDcls
 and TcDeriv to streamline all of this.
 }}}

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


More information about the ghc-tickets mailing list