Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#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: Generics Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: 7255 Differential Rev(s):
Wiki Page:


Input file:

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

import GHC
import GHC.Generics

deriving instance Generic (HsExpr Id)


GHCi, version 7.4.2:  :? 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:


Change History (5)

comment:1 Changed 7 years ago by simonpj

difficulty: Unknown
Owner: set to dreixel

With HEAD we get

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

    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?


comment:2 Changed 7 years ago by igloo

Milestone: 7.8.1

comment:3 Changed 7 years ago by dreixel

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

comment:4 Changed 7 years ago by dreixel

Resolution: duplicate
Status: newclosed

Already fixed in #7255.

comment:5 Changed 3 years ago by RyanGlScott

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