Opened 3 years ago

Closed 2 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 Revisions:

Description

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 7.6.0.20120810 for x86_64-unknown-linux):
        tc_hs_type: bang

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

Attachments (1)

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

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 years ago by parcs

  • Status changed from new to patch

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

comment:2 Changed 3 years ago by patrick@…

commit 62da65a6ba728603b0ee4dab31cd9d59123f3135

Author: Patrick Palka <[email protected]>
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 3 years ago by pcapriotti

  • difficulty set to Unknown
  • Resolution set to fixed
  • Status changed from patch to closed

Thanks for the patch.

comment:4 Changed 3 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

Simon

comment:5 Changed 3 years ago by simonpj

  • Status changed from closed to merge

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

comment:6 Changed 2 years ago by igloo

  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.