Opened 6 years ago

Closed 6 years ago

#6055 closed bug (fixed)

panic: ctFlavId: derived constraint cannot have id

Reported by: Lemming Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.5
Keywords: Cc: mikhail.vorozhtsov@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: typecheck/should_compile/T6055
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


When trying to check, whether GHC-7.5 still suffers from #5970 I found another bug: When I compile the attached module I get the type error:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.5.20120426 for i386-unknown-linux):
        ctFlavId: derived constraint cannot have id
    pty   = llvm-extra-0.4:LLVM.Extra.Extension.X86.Add'{tc rj}
              llvm-extra-0.4:LLVM.Extra.Extension.X86.D1{tc ri}
              llvm-extra-0.4:LLVM.Extra.Extension.X86.D1{tc ri}
              llvm-extra-0.4:LLVM.Extra.Extension.X86.D2{tc rh}

Please report this as a GHC bug:

I tried hard to simplify the example and to remove all dependencies (llvm, type-level), but the test case is still rather involved.

Unfortunately it is again a problem with functional dependencies and I want to get rid of them anyway, but instead switching to type families and then to type level natural numbers I prefer to switch to type level numbers immediately.

Attachments (1)

X86.hs (783 bytes) - added by Lemming 6 years ago.
compiling this module let ghc-7.5.20120426 crash in type checking phase

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by Lemming

Attachment: X86.hs added

compiling this module let ghc-7.5.20120426 crash in type checking phase

comment:1 Changed 6 years ago by dimitris

My bad, I know what is going on. It's a silly mistake (but I am amazed our testsuite did not show this yet!). I will push the fix and add the testsuite in a couple of hours. Many thanks for this testcase!

comment:2 Changed 6 years ago by mikhail.vorozhtsov

Cc: mikhail.vorozhtsov@… added

comment:3 Changed 6 years ago by simonpj@…

commit 081ee177f3727a4c1bfad5897cab51e30c209521

Author: Simon Peyton Jones <>
Date:   Mon Apr 30 16:20:01 2012 +0100

    Egregious typo (fixes Trac #6055)

 compiler/typecheck/TcInteract.lhs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

comment:4 Changed 6 years ago by simonpj

difficulty: Unknown
Resolution: fixed
Status: newclosed
Test Case: typecheck/should_compile/T6055
Note: See TracTickets for help on using tickets.