GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T18:50:35Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/7269GeneralizedNewtypeDeriving and PolyKinds2019-07-07T18:50:35ZdreixelGeneralizedNewtypeDeriving and PolyKindsThe 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 instanc...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.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GeneralizedNewtypeDeriving and PolyKinds","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"dreixel"},"version":"7.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following code\r\n\r\n{{{\r\n{-# LANGUAGE PolyKinds #-}\r\n{-# LANGUAGE GeneralizedNewtypeDeriving #-}\r\n\r\nclass C (a :: k)\r\n\r\ninstance C Int\r\n\r\nnewtype MyInt = MyInt Int deriving C\r\n}}}\r\n\r\nfails with this error:\r\n{{{\r\n Cannot derive well-kinded instance of form `C k (MyInt ...)'\r\n Class `C' expects an argument of kind `k'\r\n In the newtype declaration for `MyInt'\r\n}}}\r\n\r\nI believe this should work, and I think I know what's going on. I'm working on it.","type_of_failure":"OtherFailure","blocking":[]} -->7.8.3dreixeldreixel