[GHC] #15692: GHC panic from pattern synonyms + deferred type errors
GHC
ghc-devs at haskell.org
Sat Oct 6 23:40:56 UTC 2018
#15692: GHC panic from pattern synonyms + deferred type errors
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: merge
Priority: normal | Milestone: 8.6.2
Component: Compiler | Version: 8.6.1
Resolution: | Keywords:
| PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Compile-time | Test Case:
crash or panic | patsyn/should_fail/T15692
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Iceland_jack):
Is this the same issue?
{{{#!hs
{-# Language DataKinds, PatternSynonyms, KindSignatures, GADTs #-}
{-# Options_GHC -fdefer-type-errors #-}
import Data.Kind
data N = O | S N
data Fin :: N -> Type where
FinO :: Fin (S n)
data Exists :: (Type -> Type) -> Type where
Exists :: f xx -> Exists f
pattern O' = Exists FinO
}}}
{{{
$ ghci -ignore-dot-ghci hs/486.hs
GHCi, version 8.7.20180828: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( hs/486.hs, interpreted )
hs/486.hs:15:21: warning: [-Wdeferred-type-errors]
• Couldn't match kind ‘*’ with ‘N’
When matching types
a :: * -> *
Fin :: N -> *
Expected type: a xx
Actual type: Fin a0
• In the pattern: FinO
In the pattern: Exists FinO
In the declaration for pattern synonym ‘O'’
|
15 | pattern O' = Exists FinO
| ^^^^
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.7.20180828 for x86_64-unknown-linux):
urk! lookup local fingerprint
$mO'
[iESflb :-> ($trModule, 1ca40dc83a9c879effdb760462cc9a2d),
iESgex :-> ($tc'O, 111d9d0cf0cb57db9c77a4d216344e54),
iESgKA :-> ($tc'S, 2d7f65aefd4d8c7deac332c17204e2c9),
iESgKC :-> ($tcN, 04f8b57a4955bc680fd71fe4cee31a00),
iESgKD :-> ($tc'FinO, a20e4215870bd6fb39afb23de637e84a),
iESgKF :-> ($tcFin, 8a38d4451422cc87d0cc0459132dad73),
iESgKG :-> ($tc'Exists, 365c3f6bd1b8c9580d1ae883b83c2c68),
iESgKI :-> ($tcExists, 11a84f66f5d99fe1d3547c0ad0f538ae)]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in
ghc:Outputable
pprPanic, called at compiler/iface/MkIface.hs:524:37 in
ghc:MkIface
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15692#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list