Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#11356 closed bug (fixed)

GHC panic

Reported by: Iceland_jack Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler (Type checker) Version: 8.1
Keywords: TypeInType Cc:
Operating System: Linux Architecture: x86
Type of failure: Compile-time crash Test Case: typecheck/should_fail/T11356
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

The attached file causes GHC (version 8.1.20160102) panic.

I tried shrinking, attached code is bogus at this point.

Interestingly inlining the type synonym T = Nat into Category's superclass context fixes the panic, and causes a regular error.

Attachments (2)

Foo.hs (469 bytes) - added by Iceland_jack 19 months ago.
Foo.log (2.9 KB) - added by Iceland_jack 19 months ago.
ghci -ignore-dot-ghci -v /tmp/Foo.hs &> /tmp/Foo.log

Download all attachments as: .zip

Change History (9)

Changed 19 months ago by Iceland_jack

Attachment: Foo.hs added

Changed 19 months ago by Iceland_jack

Attachment: Foo.log added

ghci -ignore-dot-ghci -v /tmp/Foo.hs &> /tmp/Foo.log

comment:1 Changed 19 months ago by mpickering

Keywords: TypeInType added

comment:2 Changed 19 months ago by simonpj

I'm on this

comment:3 Changed 19 months ago by Simon Peyton Jones <simonpj@…>

In a5cea73c/ghc:

Turn AThing into ATcTyCon, in TcTyThing

This change tidies up and simplifies (a bit) the knot-tying
when kind-checking groups of type and class declarations.

The trouble (shown by Trac #11356) was that we wanted an error message
(a kind-mismatch) that involved a type mentioned a (AThing k), which
blew up.

Since we now seem to have TcTyCons, I decided to use them here.
It's still not great, but it's easier to understand and more robust.

comment:4 Changed 19 months ago by simonpj

Status: newmerge
Test Case: typecheck/should_fail/T11356

comment:5 Changed 19 months ago by simonpj

Milestone: 8.0.1

comment:6 Changed 19 months ago by bgamari

Resolution: fixed
Status: mergeclosed

comment:7 Changed 19 months ago by goldfire

Great -- thanks. I had been wanting to do a similar refactoring now that we have TcTyCon. I actually think there's even more we can do here, reducing the knot to including only the final zonk. Zonking a tycon would just look up the loopy tycon. But no more knot-tied tycons during typechecking and no more mkNakedXXX functions.

Note: See TracTickets for help on using tickets.