
#16191: GHC Panic deriving unbox vector (StrictData/unbox-strict-fields interaction) -------------------------------------+------------------------------------- Reporter: dbeacham | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dbeacham): Here's a much shorter example without TH or Vector. {{{ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE StrictData #-} {-# OPTIONS_GHC -funbox-strict-fields #-} module Lib where data V a = V a a deriving (Show) data family Test a newtype instance Test (V a) = V_V (a, a) }}} with this error: {{{ ghc: panic! (the 'impossible' happened) (GHC version 8.6.3 for x86_64-unknown-linux): applyTypeToArgs Expression: V_V @ a_a1BO dt_a1R2 dt_a1R3 Type: forall a. (a, a) -> Test (V a) Args: [TYPE: a_a1BO, dt_a1R2, dt_a1R3] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable pprPanic, called at compiler/coreSyn/CoreUtils.hs:234:14 in ghc:CoreUtils }}} Removing either StrictData or -funbox-strict-fields makes it compile. Maybe of interest that removing StrictData but adding in explicit strictness compiles OK: {{{ {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -funbox-strict-fields #-} module Lib where data V a = V !a !a deriving (Show) data family Test a newtype instance Test (V a) = V_V (a, a) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16191#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler