Ticket #7238 (closed bug: fixed)

Opened 8 months ago

Last modified 7 months ago

class methods with associated equality constraints panic

Reported by: dmwit Owned by: simonpj
Priority: normal Milestone:
Component: Compiler Version: 7.6.1
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: polykinds/T7238 Blocked By:
Blocking: Related Tickets:

Description

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 _ = ()

Change History

Changed 8 months ago by simonpj

  • owner set to simonpj
  • difficulty set to Unknown

Thanks! I'm on this.

Changed 8 months ago by simonpj@…

commit 7d83fdea229b940ae198ddc5c179ac449defd2ef

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Sat Sep 15 00:12:16 2012 +0100

    Bind "given" evidence to a variable, always
    
    This was being done in xCtFlavor, but not in rewriteCtFlavor,
    resulting in Trac #7238.
    
    See Note [Bind new Givens immediately] in TcSMonad and
    and Note [Coercion evidence terms] in TcEvidence.

 compiler/typecheck/TcEvidence.lhs |   29 ++++++++++++++---------------
 compiler/typecheck/TcSMonad.lhs   |   26 +++++++++++++++++---------
 2 files changed, 31 insertions(+), 24 deletions(-)

Changed 8 months ago by simonpj

  • status changed from new to merge
  • testcase set to polykinds/T7238

Great, thanks. Now fixed.

Changed 7 months ago by igloo

  • status changed from merge to closed
  • resolution set to fixed

Merged as cd980830b4ffdb4fe5b68f8dc1d83acc4ab03a5b

Note: See TracTickets for help on using tickets.