#7255 closed bug (fixed)

Wrong suggestion when deriving Generic on an instantiated type

Reported by: dreixel Owned by: dreixel
Priority: normal Milestone:
Component: Compiler Version: 7.6.1
Keywords: Cc: nfrisby
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: GenCannotDoRep0 Blocked By:
Blocking: Related Tickets:

Description

The following code

{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE FlexibleInstances  #-}

import GHC.Generics

data A a

data B

deriving instance Generic (A B)

gives rise to the error

    Can't make a derived instance of `Generic (A B)':
      A must not be instantiated; try deriving `A B' instead
    In the stand-alone deriving instance for `Generic (A B)'

It should indeed fail, but the suggestion should be to try deriving A a instead.

Change History (3)

comment:1 Changed 19 months ago by nfrisby

  • Cc nfrisby added

comment:2 Changed 19 months ago by jpm@…

commit a17da16f08ae24e24ebe671d0731c43b240008f5

Author: Jose Pedro Magalhaes <jpm@cs.ox.ac.uk>
Date:   Fri Sep 21 10:40:24 2012 +0100

    FIX #7255: print tyConTyVars tc, not tc_args

 compiler/typecheck/TcGenGenerics.lhs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

comment:3 Changed 19 months ago by dreixel

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to GenCannotDoRep0

Fixed. Turns out we even had a test for this already, and somehow were accepting the wrong output; fixed that too.

Note: See TracTickets for help on using tickets.