#7035 closed bug (duplicate)

`deriving instance Generic (HsExpr Id)` raises panic

Reported by: Daniel Schuessler Owned by: dreixel
Priority: normal Milestone: 7.8.1
Component: Compiler Version: 7.4.2
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets: 7255

Description

Input file:

{-# LANGUAGE FlexibleInstances, DeriveGeneric, StandaloneDeriving #-}
module GHCGeneric where

import GHC
import GHC.Generics

deriving instance Generic (HsExpr Id)

Result:

GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling GHCGeneric       ( /home/daniel/dev/dataflow/GHCGeneric.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.2 for i386-unknown-linux):
        tcTyVarDetails ( id{tv a3cX} [tv] :: *{(w) tc 34d} )

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

Regards,
Daniel

Change History (4)

comment:1 Changed 22 months ago by simonpj

  • Difficulty set to Unknown
  • Owner set to dreixel

With HEAD we get

~/tmp$ ~/5builds/HEAD-1/inplace/bin/ghc-stage2 -c T7035.hs -package ghc

T7035.hs:8:1:
    Can't make a derived instance of `Generic (HsExpr Id)':
      HsExpr must not be instantiated; try deriving `HsExpr Id' instead
    In the stand-alone deriving instance for `Generic (HsExpr Id)'

Better than a crash, but the error message is messed up. Should say something like try deriving (HsExpr a) instead, or something. Currently it says "X doesn't work, so try X" which is stupid.

Pedro, can you look at this?

Simon

comment:2 Changed 18 months ago by igloo

  • Milestone set to 7.8.1

comment:3 Changed 18 months ago by dreixel

Somehow I've only seen this now. I think it's fixed by now, but I'll check.

comment:4 Changed 18 months ago by dreixel

  • Resolution set to duplicate
  • Status changed from new to closed

Already fixed in #7255.

Note: See TracTickets for help on using tickets.