[GHC] #13102: orphan family instances can leak through the EPS in --make mode

GHC ghc-devs at haskell.org
Tue Feb 14 21:57:47 UTC 2017


#13102: orphan family instances can leak through the EPS in --make mode
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                Owner:  rwbarton
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"bedcb71659253bb8ab5d449df8e3ee884cc85d46/ghc" bedcb71/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="bedcb71659253bb8ab5d449df8e3ee884cc85d46"
 Check local type family instances against all imported ones

 We previously checked type family instance declarations
 in a module for consistency with all instances that we happened
 to have read into the EPS or HPT. It was possible to arrange that
 an imported type family instance (used by an imported function)
 was in a module whose interface file was never read during
 compilation; then we wouldn't check consistency of local instances
 with this imported instance and as a result type safety was lost.

 With this patch, we still check consistency of local type family
 instances with all type family instances that we have loaded; but
 we make sure to load the interface files of all our imports that
 define family instances first. More selective consistency checking
 is left to #13102.

 On the other hand, we can now safely assume when we import a module
 that it has been checked for consistency with its imports. So we
 can save checking in checkFamInstConsistency, and overall we should
 have less work to do now.

 This patch also adds a note describing the Plan for ensuring type
 family consistency.

 Test Plan: Two new tests added; harbormaster

 Reviewers: austin, simonpj, bgamari

 Reviewed By: simonpj, bgamari

 Subscribers: ggreif, thomie

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

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


More information about the ghc-tickets mailing list