Skip to content

class methods with associated equality constraints panic

The following file causes a panic ("getEqPredTys"):

{-# LANGUAGE ConstraintKinds, TypeFamilies #-}
import GHC.Exts

class Pair p where
	type Ctxt p a :: Constraint
	l :: Ctxt p a => p a -> a

data Unit a = Unit

instance Pair Unit where
	type Ctxt Unit a = a ~ ()
	l _ = ()
Trac metadata
Trac field Value
Version 7.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information