Opened 3 years ago

Closed 3 years ago

#5513 closed bug (fixed)

panic! (the 'impossible' happened) on ‘deriving instance lowercase_name a’

Reported by: andersk Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty:
Test Case: rename/should_fail/T5513 Blocked By:
Blocking: Related Tickets:

Description

This bogus code:

{-# LANGUAGE StandaloneDeriving #-}
deriving instance lowercase_name a

causes current GHC HEAD to panic:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.3.20110927 for x86_64-unknown-linux):
	nameModule lowercase_name{tv aar}

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

I also tested GHC 7.0.3, which correctly diagnosed the problem:

crash.hs:2:19: Malformed instance header: lowercase_name a

Change History (2)

comment:1 Changed 3 years ago by simonpj@…

commit ce1f1cd5f0ec5f07475e44cf2b7f72e0cbb8a963

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Thu Sep 29 16:47:57 2011 +0100

    Tidy up the shape-checking for instance types
    (in instance and standalone deriving decls)
    
    Fixes Trac #5513.

 compiler/parser/Parser.y.pp  |    7 +++----
 compiler/parser/RdrHsSyn.lhs |   21 ---------------------
 compiler/rename/RnNames.lhs  |   10 +++++++---
 compiler/rename/RnSource.lhs |    4 ++--
 compiler/rename/RnTypes.lhs  |   17 ++++++++++++++++-
 5 files changed, 28 insertions(+), 31 deletions(-)

comment:2 Changed 3 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to rename/should_fail/T5513

Thaks for the report; now fixed.

Simon

Note: See TracTickets for help on using tickets.