Opened 3 years ago

Closed 3 years ago

#7614 closed bug (duplicate)

tc_hs_type: bang : The impossible happened

Reported by: erikd Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.1
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):


A simple data structure with bang patterns like the following:

data MyType
    = MyType
        { a :: !Int
        , b :: !Maybe Int

results in:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.1 for x86_64-unknown-linux):
        tc_hs_type: bang

Adding parentheses around the "Maybe Int" like this:

data MyType
    = MyType
        { a :: !Int
        , b :: !(Maybe Int)

is accepted, but it would be nice if the former example printed a syntax error or some sort of other warning rather than just a panic.

Change History (1)

comment:1 Changed 3 years ago by simonpj

  • difficulty set to Unknown
  • Resolution set to duplicate
  • Status changed from new to closed

Thanks. It's a dup of #7210. Happily HEAD says

    Unexpected strictness annotation: !Maybe
    In the type `!Maybe Int'
    In the definition of data constructor `MyType'
    In the data declaration for `MyType'

I think this is ok.


Note: See TracTickets for help on using tickets.