Opened 8 years ago

Closed 8 years ago

#6011 closed bug (fixed)

Panic when using a type synonym

Reported by: mm_freak Owned by: pcapriotti
Priority: normal Milestone: 7.6.1
Component: Compiler Version: 7.4.1
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Test Case: typecheck/should_compile/T6011
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I'm getting the following "the impossible happened" error when trying to compile the code in the attachment:

[2 of 3] Compiling Data.Mod.FiniteRing ( Data/Mod/FiniteRing.hs, dist/build/Data/Mod/FiniteRing.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-unknown-linux):
    Data constructor `modular-0.1.0:Data.Mod.Types.FiniteRing{d r0}'

This only happens when I use the Mod type synonym. When I spell the full GenMod type everything works fine. Also the first compilation run after a "cabal clean" works fine.

Steps to reproduce:

  1. Unpack the attached cabal package.
  2. Compile (cabal configure, cabal build).
  3. Touch Data/Mod/FiniteRing.hs.
  4. Compile again (cabal build).

Attachments (2)

modular-0.1.0.tar.gz (2.5 KB) - added by mm_freak 8 years ago.
FiniteRing.hs (330 bytes) - added by pcapriotti 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by mm_freak

Attachment: modular-0.1.0.tar.gz added

Changed 8 years ago by pcapriotti

Attachment: FiniteRing.hs added

comment:1 Changed 8 years ago by pcapriotti

difficulty: Unknown

The attached FiniteRing.hs is a minimal test case reproducing the problem on 7.4.1. The issue seems to be fixed in 7.4.2 and HEAD, though.

comment:2 Changed 8 years ago by simonpj

Owner: set to pcapriotti

Great. Paolo, can you just add the test case (in indexed-types/should_compile/T6011, and close? Thanks


comment:3 Changed 8 years ago by pcapriotti

Milestone: 7.6.1
Resolution: fixed
Status: newclosed
Test Case: typecheck/should_compile/T6011
Note: See TracTickets for help on using tickets.