Pattern synonyms defined through other pattern synonyms produce `impossible happened` in ghci/runhaskell
This module content (Bug.hs)
{-# language PatternSynonyms #-}
data A a = A a
pattern B a = A a
pattern C a = B a
causes ghci/runhaskell to fail:
> :l Bug
[1 of 1] Compiling Main ( Bug.hs, interpreted )
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.1 for x86_64-unknown-linux):
kindPrimRep.go rep_a1r0
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
When using ghc everything compiles and even works, so adding the code
main = do
let C a = A 1
print a
produced executable that prints "1".
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |
Edited by Heimdell