Opened 3 years ago

Closed 11 months ago

#7269 closed bug (fixed)

GeneralizedNewtypeDeriving and PolyKinds

Reported by: dreixel Owned by: dreixel
Priority: normal Milestone: 7.8.3
Component: Compiler Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: deriving/should_compile/T7269
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

The following code

{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

class C (a :: k)

instance C Int

newtype MyInt = MyInt Int deriving C

fails with this error:

    Cannot derive well-kinded instance of form `C k (MyInt ...)'
      Class `C' expects an argument of kind `k'
    In the newtype declaration for `MyInt'

I believe this should work, and I think I know what's going on. I'm working on it.

Change History (7)

comment:1 Changed 2 years ago by igloo

  • difficulty set to Unknown
  • Milestone set to 7.8.1

comment:2 Changed 13 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.10.1

Moving to 7.10.1

comment:3 Changed 12 months ago by Simon Peyton Jones <simonpj@…>

In b1436f55da2b0e005ac09be6651a2c4d934027ec/ghc:

Fix yet another bug in 'deriving' for polykinded classes (Trac #7269)

This patch makes the code a bit simpler if anything.

comment:4 Changed 12 months ago by simonpj

  • Status changed from new to merge
  • Test Case set to deriving/should_compile/T7269

Fixed at last.

comment:5 Changed 12 months ago by nomeata

Please add the test case:

<command line>: does not exist: T7269.hs

*** unexpected failure for T7269(normal)

comment:6 Changed 12 months ago by simonpj

Sorry, done

comment:7 Changed 11 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.8.3
  • Resolution set to fixed
  • Status changed from merge to closed

Merged into 7.8.3.

Note: See TracTickets for help on using tickets.