Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#8553 closed bug (fixed)

ASSERT failed compiler/typecheck/TcMType.lhs line 809

Reported by: nomeata Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case: gadt6 T7474 T5246
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


With current master (9c2dade94fae5f4fe19cd972ca1f1049c633e4ed) I get

[1 of 1] Compiling ShouldCompile    ( ../ghc/gadt6.hs, ../ghc/gadt6.o )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.7.20131121 for x86_64-unknown-linux):
	ASSERT failed!
    file compiler/typecheck/TcMType.lhs line 809
    [W] cobox_aBx{v} [lid] :: t_aBv{tv} [tau[0]]
                              ghc-prim:GHC.Types.~{(w) tc 31Q} t_aBu{tv} [tau[0]] (CIrredEvCan)

(And it took me a while to figure out that it was not my code that was introducing the bug.)

According to git log -L 809,809:compiler/typecheck/TcMType.lhs (a useful feature) the history of the ASSERT is:

Change History (6)

comment:1 Changed 3 years ago by nomeata

Test Case: gadt6

Forgot to mention; This occurs when compiling source:testsuite/tests/gadt/gadt6.hs

comment:2 Changed 3 years ago by nomeata

Test Case: gadt6gadt6 T7474 T5246

(This also affects TEST="gadt6 T7474 T5246")

comment:3 Changed 3 years ago by Joachim Breitner <mail@…>

In 9f10d5ba0fae4357f962032dda1be5316c16db1b/testsuite:

Mark tests as expect_broken when borken with -DDEBUG

The related bugs are #8553 and #8525.

comment:4 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

In 985663ea47487a9e567814ba000e81d65358bf02/ghc:

Fix type-equality in the type checker (fixes Trac #8553)

For horrible reasons (Note [Comparison with OpenTypeKind] in Type), the
function Type.eqType currently equates OOpenKind with *.  This may or may
not be a good idea (it's certainly a revolting one) but it DOES NOT WORK
in the type checker, which *does* need to distinguish OpenKind and *.

Rather than solve the underlying problem (I have some ideas) I just
introduced a new, and very short, simple, straightforward function
TcType.tcEqType to do the job.

comment:5 Changed 3 years ago by simonpj

Resolution: fixed
Status: newclosed

This really was a bug, now fixed. (The particular manifestation was that TcCanonical.reOrient didn't fire when it should have done so.)

I don't know how to test this; it requires the DEBUG compiler.


comment:6 Changed 3 years ago by Joachim Breitner <mail@…>

In 81a49bcc84f27245d11c5b151d41b2026a5a6602/testsuite:

T5246 and T7474 back working with -DDEBUG

thanks to SPJ'S fixes for #8553 in 985663ea47487a9e567814ba000e81d65358bf02
Note: See TracTickets for help on using tickets.