Ticket #2334 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

panic using type families and type classes

Reported by: pgavin Owned by: simonpj
Priority: normal Milestone: 6.10 branch
Component: Compiler Version: 6.9
Keywords: type families Cc:
Operating System: MacOS X Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: indexed-types/T2334 Blocked By:
Blocking: Related Tickets:

Description (last modified by simonmar) (diff)

I got a panic while trying to compile some code using type families:

ghc-6.9.20080528: panic! (the 'impossible' happened)
  (GHC version 6.9.20080528 for i386-apple-darwin):
        urk! lookup local fingerprint

I can't post the code that caused that (yet) but when I was trying to distill it down to its essence for a bug report, I got a different panic:

ghc-6.9.20080528: panic! (the 'impossible' happened)
  (GHC version 6.9.20080528 for i386-apple-darwin):
        Prelude.head: empty list

I've attached the code that caused it. I know the code might not be 100% correct, and it's a bit long, but I think it might help some.

Attachments

Test.hs Download (0.9 KB) - added by pgavin 5 years ago.

Change History

Changed 5 years ago by pgavin

Changed 5 years ago by simonmar

  • difficulty set to Unknown
  • description modified (diff)

Changed 5 years ago by simonmar

The following smaller example elicits the "Data.List.head: empty list" panic:

{-# LANGUAGE TypeFamilies,EmptyDataDecls,MultiParamTypeClasses #-}
module Test where

data family F r
newtype instance F () = F deriving Eq

and it seems to happen during Renamer/Typechecker. Removing "deriving (Eq)" makes the error go away.

Changed 5 years ago by simonmar

  • milestone set to 6.10 branch

The "lookup local fingerprint" crash is fixed by:

Wed Jun  4 12:30:02 BST 2008  Simon Marlow <marlowsd@gmail.com>
  * Fix #2334: tyvar binders can have Names inside (equality predicates)

The "Data.List.head: empty list" panic is still to be fixed, see above (and this is not my area, perhaps Simon or Manuel could take a look?).

Changed 5 years ago by simonpj

  • owner set to simonpj

I'm working on a fix.

Changed 5 years ago by simonpj

  • status changed from new to closed
  • testcase set to indexed-types/T2334
  • resolution set to fixed

Fixed

Fri Jun  6 13:17:30 BST 2008  simonpj@microsoft.com
  * Fix Trac #2334: validity checking for type families

Type families aren't advertised in 6.8, so no need to merge.

Simon

Note: See TracTickets for help on using tickets.