Opened 2 years ago

Closed 2 years ago

#5961 closed bug (fixed)

GHC panic (nameModule) on malformed deriving clause

Reported by: Philonous Owned by:
Priority: normal Milestone: 7.6.1
Component: Compiler Version: 7.4.1
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Trying to derive a classname starting with a lower case letter and wrapped in parenthesis will lead to a ghc panic instead of generating an error

minimal testcase:

module Foo where
data Foo = Foo deriving (abc)

output:

[1 of 1] Compiling Foo              ( scratch3.hs, scratch3.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
        nameModule abc{tv a9I}

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

Change History (2)

comment:1 Changed 2 years ago by pcapriotti

  • Difficulty set to Unknown
  • Milestone set to 7.6.1

Thanks for the report. This seems to be fixed in HEAD.

comment:2 Changed 2 years ago by simonpj

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

Indeed:

T5961.hs:2:26:
    Illegal deriving item `abc'
    In the data declaration for `Foo'
Note: See TracTickets for help on using tickets.