Opened 5 years ago

Closed 5 years ago

#7280 closed bug (fixed)

zonkQuantifiedTyVar panic

Reported by: rl Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: indexed-types/should_compile/T7280
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Small program (extracted from the dev version of vector):

{-# LANGUAGE Rank2Types, MultiParamTypeClasses, FlexibleContexts, TypeFamilies, ScopedTypeVariables #-}

module T where

type family Mutable (v :: * -> *) :: * -> * -> *
class MVector (v :: * -> * -> *) a
class MVector (Mutable v) a => Vector v a where
  copy :: Monad m => Mutable v s a -> v a -> m ()

data Chunk v s a = Chunk (forall m. (Monad m, Vector v a) => Mutable v s a -> m ())

vstep (v:vs) = Chunk (\mv -> copy mv v)

When I compile this, I get:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.6.1 for x86_64-unknown-linux):
	zonkQuantifiedTyVar f_afr{tv} [fsk]

Change History (1)

comment:1 Changed 5 years ago by simonpj

difficulty: Unknown
Resolution: fixed
Status: newclosed
Test Case: indexed-types/should_compile/T7280

Thanks for the report. It turns out to be a bug in the branch only so I've fixed it there

commit 439ddf9182489c1c4f03ff9eecb460796be829fe
Author: Simon Peyton Jones <>
Date:   Mon Oct 8 08:33:41 2012 +0100

    Fix Trac #7280 by zonking the final_quant_candidates in simplifyInfer
    This fix is only needed on the branch; HEAD already works differently
    (and correctly).

 compiler/typecheck/TcSimplify.lhs |    2 ++
 1 file changed, 2 insertions(+)

I've added a regression test to HEAD.

Note: See TracTickets for help on using tickets.