GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2020-02-25T01:15:47Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/15862Panic with promoted types that Typeable doesn't support2020-02-25T01:15:47ZRyan ScottPanic with promoted types that Typeable doesn't supportThe following program panics on GHC 8.2 and later:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
module Bug where
import Type.Reflection
newtype Foo ...The following program panics on GHC 8.2 and later:
```hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeApplications #-}
module Bug where
import Type.Reflection
newtype Foo = MkFoo (forall a. a)
foo :: TypeRep MkFoo
foo = typeRep @MkFoo
```
```
$ /opt/ghc/8.6.1/bin/ghc Bug.hs
[1 of 1] Compiling Bug ( Bug.hs, Bug.o )
GHC error in desugarer lookup in Bug:
attempting to use module ‘main:Bug’ (Bug.hs) which is not loaded
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.1 for x86_64-unknown-linux):
initDs
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.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":"Typeable panic with promoted rank-2 kind (initDs)","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":["Typeable"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"The following program panics on GHC 8.2 and later:\r\n\r\n{{{#!hs\r\n{-# LANGUAGE DataKinds #-}\r\n{-# LANGUAGE ImpredicativeTypes #-}\r\n{-# LANGUAGE RankNTypes #-}\r\n{-# LANGUAGE TypeApplications #-}\r\nmodule Bug where\r\n\r\nimport Type.Reflection\r\n\r\nnewtype Foo = MkFoo (forall a. a)\r\n\r\nfoo :: TypeRep MkFoo\r\nfoo = typeRep @MkFoo\r\n}}}\r\n{{{\r\n$ /opt/ghc/8.6.1/bin/ghc Bug.hs\r\n[1 of 1] Compiling Bug ( Bug.hs, Bug.o )\r\nGHC error in desugarer lookup in Bug:\r\n attempting to use module ‘main:Bug’ (Bug.hs) which is not loaded\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 8.6.1 for x86_64-unknown-linux):\r\n initDs\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->8.8.1Ryan ScottRyan Scott