Opened 5 years ago

Closed 5 years ago

#7210 closed bug (fixed)

Bang in front of type name crashes GHC

Reported by: tibbe Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.1-rc1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When adding a bang to a type constructor applied to a type, I forgot to surround it with parenthesis:

module Test where

import Data.IntMap

data T = C { f :: !IntMap Int }

leading to the following crash:

[1 of 1] Compiling Test             ( Control/Distributed/Hayride/Test.hs, interpreted )
ghc: panic! (the 'impossible' happened)
  (GHC version for x86_64-unknown-linux):
        tc_hs_type: bang

Please report this as a GHC bug:

Attachments (1)

0001-Fail-nicely-when-encountering-an-invalid-bang-annota.patch (1.4 KB) - added by parcs 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by parcs

Status: newpatch

I've attached a patch that seems to fix this issue.

comment:2 Changed 5 years ago by patrick@…

commit 62da65a6ba728603b0ee4dab31cd9d59123f3135

Author: Patrick Palka <>
Date:   Mon Sep 3 10:27:26 2012 -0400

    Fail nicely when encountering an invalid bang annotation (#7210)

 compiler/typecheck/TcHsType.lhs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

comment:3 Changed 5 years ago by pcapriotti

difficulty: Unknown
Resolution: fixed
Status: patchclosed

Thanks for the patch.

comment:4 Changed 5 years ago by simonpj

Paolo: did you add a regression test? It'd be good to add it to the "test case" field of the ticket. Thanks


comment:5 Changed 5 years ago by simonpj

Status: closedmerge

I think it'd be good to merge this to the 7.6 branch; cf #7271

comment:6 Changed 5 years ago by igloo

Status: mergeclosed
Note: See TracTickets for help on using tickets.