
#14680: GHC 8.4.1-alpha panics when optimizing function using getTag and tagToEnum# -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: Compiler | Version: 8.4.1-alpha1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: simonpj (added) Comment: This regression was introduced in commi 193664d42dbceadaa1e4689dfa17ff1cf5a405a0 (`Re-engineer caseRules to add tagToEnum/dataToTag`). cc'ing simonpj, who authored this. From glancing at that diff, I can at least see why this happening. It's due to [http://git.haskell.org/ghc.git/blob/c65104e1a6875f7879db87877848cc35363c1bf3... this line]: {{{#!hs get_con ty tag = tyConDataCons (tyConAppTyCon ty) !! tag }}} But we're dealing with a data family here, so oughtn't we be using the //representation// tycon here, not `tyConAppTyCon`? It's likely that `tyConAppTyCon ty` is returning an empty list when `ty` is headed by a data family, which would explain the panic. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14680#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler