[GHC] #14916: Missing checks when deriving special classes

GHC ghc-devs at haskell.org
Mon Mar 26 00:12:26 UTC 2018


#14916: Missing checks when deriving special classes
-------------------------------------+-------------------------------------
        Reporter:  kosmikus          |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.2
  checker)                           |
      Resolution:                    |             Keywords:  Deriving
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4501
       Wiki Page:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"20f14b4fd4eaf2c3ab375b8fc6d40ee9e6db94fd/ghc" 20f14b4/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="20f14b4fd4eaf2c3ab375b8fc6d40ee9e6db94fd"
 Fix #14916 with an additional validity check in deriveTyData

 Manually-written instances and standalone-derived instances
 have the benefit of having the `checkValidInstHead` function run over
 them, which catches manual instances of built-in types like `(~)` and
 `Coercible`. However, instances generated from `deriving` clauses
 weren't being passed through `checkValidInstHead`, leading to
 confusing results as in #14916.

 `checkValidInstHead` also has additional validity checks for language
 extensions like `FlexibleInstances` and `MultiParamTypeClasses`. Up
 until now, GHC has never required these language extensions for
 `deriving` clause, so to avoid unnecessary breakage, I opted to
 suppress these language extension checks for `deriving` clauses, just
 like we currently suppress them for `SPECIALIZE instance` pragmas.

 Test Plan: make test TEST=T14916

 Reviewers: goldfire, bgamari

 Reviewed By: bgamari

 Subscribers: rwbarton, thomie, carter

 GHC Trac Issues: #14916

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

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


More information about the ghc-tickets mailing list