Opened 3 years ago

Closed 3 years ago

#5478 closed bug (fixed)

GHC panics when asked to derive Show for ByteArray#

Reported by: hvr Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty:
Test Case: deriving/should_fail/T5478 Blocked By:
Blocking: Related Tickets:

Description

The following Haskell

{-# LANGUAGE MagicHash #-}

import GHC.Exts

data Foo = Foo0 ByteArray#
         deriving Show

main = return ()

caused GHC to panic with

[1 of 1] Compiling Main             ( ticket_5478.hs, ticket_5478.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.2.1 for x86_64-unknown-linux):
	Error in deriving:
    Can't derive Show for primitive type ghc-prim:GHC.Prim.ByteArray#{(w) tc 3f}

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

Change History (3)

comment:1 Changed 3 years ago by hvr

  • Summary changed from GHC panics - Can't derive Show for primitive type ByteArray# to GHC panics when asked to derive Show for ByteArray#

comment:2 Changed 3 years ago by simonpj@…

commit 99a6412c9ff5964bd957da79bd3b7d27c4f41228

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Wed Sep 14 15:28:25 2011 +0100

    Tighten up the side-condition testing for deriving (again)
    
    Fixes Trac #5478

 compiler/typecheck/TcDeriv.lhs    |   67 +++++++++++++++++++++++++++----------
 compiler/typecheck/TcGenDeriv.lhs |   19 ++++++----
 2 files changed, 60 insertions(+), 26 deletions(-)

comment:3 Changed 3 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to deriving/should_fail/T5478

Thanks for finding this bug.

Note: See TracTickets for help on using tickets.