Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#8468 closed bug (fixed)

ghc panic in deriving Generic1 on Array#

Reported by: ghorn Owned by: dreixel
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Generics Cc: gregmainland@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: generics/T8468
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Compiling the following code

{-# Language DeriveGeneric, MagicHash #-}

module Test where

import GHC.Generics
import GHC.Prim

data Array a = Array (Array# a)
newtype Vec a = MkVec {unVec :: Array a} deriving Generic1

causes panic:

[1 of 1] Compiling Test             ( Test.hs, Test.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.3 for x86_64-unknown-linux):
	No match in record selector tyConTyVars

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

some comments from IRC:

<monoidal> with deriving Generic1 we get "Can't make a derived instance of `Generic1 Array': Array must not have unlifted or polymorphic arguments" - so it seems the check is not done recursively on used types <monoidal> * deriving Generic1 on Array

Change History (6)

comment:1 Changed 6 years ago by dreixel

Owner: set to dreixel

Thanks for reporting, I'll look into this.

comment:2 Changed 6 years ago by ghorn

Cc: gregmainland@… added

comment:3 Changed 6 years ago by Jose Pedro Magalhaes <jpm@…>

In 2c74f9899ed5a99a4f6e8ea726841450c3d1211d/ghc:

fixing canDoGenerics1 (fixes #8468) (fixes #8479)

Signed-off-by: Jose Pedro Magalhaes <jpm@cs.ox.ac.uk>

comment:4 Changed 6 years ago by dreixel

Resolution: fixed
Status: newclosed
Test Case: T8468

Fixed in HEAD, thanks.

comment:5 Changed 6 years ago by simonpj

Test Case: T8468generics/T8468

comment:6 Changed 3 years ago by RyanGlScott

Keywords: Generics added
Note: See TracTickets for help on using tickets.