Ticket #7035 (closed bug: duplicate)

Opened 11 months ago

Last modified 7 months ago

`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

Changed 11 months ago by simonpj

  • owner set to dreixel
  • difficulty set to Unknown

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

Changed 7 months ago by igloo

  • milestone set to 7.8.1

Changed 7 months ago by dreixel

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

Changed 7 months ago by dreixel

  • status changed from new to closed
  • resolution set to duplicate
  • related set to 7255

Already fixed in #7255.

Note: See TracTickets for help on using tickets.