[GHC] #16002: Type family equation with wrong name is silently accepted (GHC 8.6+ only)

GHC ghc-devs at haskell.org
Fri Dec 21 04:29:15 UTC 2018


#16002: Type family equation with wrong name is silently accepted (GHC 8.6+ only)
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.6.2
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5420
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7/ghc"
 28f41f1a/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="28f41f1a7a0ebae7b50ca41dbf78c04ee5b8b5b7"
 Fix #16002 by moving a validity check to the renamer

 Summary:
 The validity check which rejected things like:

 ```lang=haskell
 type family B x where
   A x = x
 ```

 Used to live in the typechecker. But it turns out that this validity
 check was //only// being run on closed type families without CUSKs!
 This meant that GHC would silently accept something like this:

 ```lang=haskell
 type family B (x :: *) :: * where
   A x = x
 ```

 This patch fixes the issue by moving this validity check to the
 renamer, where we can be sure that the check will //always// be run.

 Test Plan: make test TEST=T16002

 Reviewers: simonpj, bgamari

 Reviewed By: simonpj

 Subscribers: goldfire, rwbarton, carter

 GHC Trac Issues: #16002

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

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


More information about the ghc-tickets mailing list