
#10072: Panic: generalised wildcards in RULES -------------------------------------+------------------------------------- Reporter: thomasw | Owner: thomasw Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1-rc2 (Type checker) | Operating System: Unknown/Multiple Keywords: | Type of failure: Compile-time Architecture: | crash Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Generalised wildcards (PartialTypeSignatures) in the binder type annotation of a RULE cause panics. Minimal example: {{{#!hs module WildcardInRuleBndrSig where {-# RULES "map/empty" forall (f :: a -> _). map f [] = [] #-} }}} Output: {{{ WildcardInRuleBndrSig.hs:3:31:ghc-stage1: panic! (the 'impossible' happened) (GHC version 7.11.20150209 for x86_64-unknown-linux): No skolem info: w__alY[sk] }}} When a wildcard is generalised over, the error message reporting the inferred type gives some extra info about the type variables occurring in the inferred type. This extra information is retrieved by looking up the skolem information (`getSkolemInfo`) for the type variables in the enclosing implications (`cec_encl`). The problem is that there are no enclosing implications in this case, hence the panic. Note that with the flags `-XPartialTypeSignatures` and `-fno-warn-partial- type-signatures` enabled, there is no panic, as no error/warning message is constructed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10072 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler