Opened 3 years ago

Closed 3 years ago

#7560 closed bug (fixed)

Panic in conflictInstErr when branched type family instances conflict

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


This code causes the panic:

{-# LANGUAGE TypeFamilies #-}

type family F a

type instance where
  F Int = Int
  F Bool = Bool

type instance where
  F Int = Char
  F Double = Double

Here is the output:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.7.20121221 for x86_64-apple-darwin):
<<details unavailable>>

Fix on the way...

Change History (2)

comment:1 Changed 3 years ago by eir@…

commit 851e4e7619200a11cfc9bda4bee6072b0245504b

Author: Richard Eisenberg <[email protected]>
Date:   Tue Jan 8 23:30:16 2013 -0500

    Fix Trac #7560.
    Code in conflictInstErr did not handle the case where some branches
    of a branched family instance had an error and some didn't. It was
    all or nothing. Now, if there are no conflicts for a given branch,
    conflictInstErr just ignores the branch instead of panicking.

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

comment:2 Changed 3 years ago by goldfire

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.