[GHC] #14331: Overzealous free-floating kind check causes deriving clause to be rejected

GHC ghc-devs at haskell.org
Mon Nov 6 14:05:17 UTC 2017


#14331: Overzealous free-floating kind check causes deriving clause to be rejected
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |
      Resolution:                    |             Keywords:  deriving
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  GHC rejects       |            Test Case:
  valid program                      |  deriving/should_compile/T14331
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 I posted this to a branch instead of Phab per SPJ's request, since he says
 he finds that easier to navigate to Phab.

 As far as `newMetaTyVars` goes: yes, I'm aware that I needn't call
 `newMetaTyVars` on //everything// in `tvs`. As I mentioned, I'm taking
 this piece-by-piece, and I wanted to get the simple case where the
 `deriving` clause mentions no variables working first before I add
 additional complexity on top (especially since the simple case is proving
 to be so difficult).

 I still need the `tcUnifyTy` because of this validity check:
 https://github.com/RyanGlScott/ghc/commit/d8ed9e57ecc60a78321ab10b02f6387759d2c82e
 #diff-6ce1356ff43cc56932867d6f6b63d7dcR718

 I'm quite confused at all the different variants of of `zonkWibbleWobble`
 out there. There's `zonkTcType` and `zonkTcTypeToType` for starters (whose
 simultaneous existence still baffles me), and now there's
 `zonkQuantifiedTyVar` and `zonkTyBndrX`‽ How is someone like me who isn't
 in the loop supposed to be able to discern all of these little
 idiosyncrasies?

 (Sorry, rant over. I frequently get overwhelmed at all of the arcane
 knowledge one needs to make simple changes to the typechecker.)

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


More information about the ghc-tickets mailing list