Opened 3 years ago

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

Description

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):
	tyThingTyCon
    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 3 years ago.
FiniteRing.hs (330 bytes) - added by pcapriotti 3 years ago.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by mm_freak

Changed 3 years ago by pcapriotti

comment:1 Changed 3 years ago by pcapriotti

  • difficulty set to 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 3 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

Simon

comment:3 Changed 3 years ago by pcapriotti

  • Milestone set to 7.6.1
  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to typecheck/should_compile/T6011
Note: See TracTickets for help on using tickets.