Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2449 closed bug (fixed)

panic with GeneralizedNewtypeDeriving and a .hs-boot file

Reported by: igloo Owned by: igloo
Priority: normal Milestone: 6.10.1
Component: Compiler Version: 6.9
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: drvfail016
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


With A.hs-boot:

module A where

data A
    deriving Show

We can get a panic:

$ ghc -c -XGeneralizedNewtypeDeriving A.hs-boot

A.hs-boot:5:13:ghc: panic! (the 'impossible' happened)
  (GHC version 6.9.20080716 for x86_64-unknown-linux):
        newTyConEtadRhs main:A.A{tc r6K}

Please report this as a GHC bug:

Change History (4)

comment:1 Changed 9 years ago by simonpj

Owner: set to igloo

Good bug. As the user manual says, you can't put deriving clauses in hs-boot files. I've made GHC check properly for this now.

Tue Aug  5 11:54:02 BST 2008
  * Fix Trac #2449
  Deriving isn't allowed in hs-boot files (says the user manual)
  This patch checks properly instead of crashing!

IAN: I'm not sure how to add a test case whose source file is a hs-boot file. Could you do so please? The one above will do fine. Thanks. Then close.


comment:2 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed
Test Case: drvfail016

Test drvfail016 added

comment:3 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:4 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.