Opened 22 months ago

Closed 22 months ago

Last modified 18 months ago

#14744 closed bug (fixed)

Non-exhaustive patterns in case in GHCi with quantified class contexts

Reported by: kosmikus Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 8.5
Keywords: QuantifiedConstraints Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This appears in the wip/T2893 branch.

To reproduce, create the following module

{-# LANGUAGE ConstraintKinds, GADTs, KindSignatures, QuantifiedConstraints #-}
module Bug where

import GHC.Exts

data Foo :: (* -> Constraint) -> * where
  MkFoo :: (forall a . c a => c (f a), c a) => (f a) -> Foo c

and load it into GHCi:

Bug> foo = MkFoo "foo" :: Foo Show
*** Exception: compiler/typecheck/TcType.hs:(1965,9)-(1985,76): Non-exhaustive patterns in case

Putting the same declaration into the module itself does not seem to trigger the bug.

Change History (3)

comment:1 Changed 22 months ago by kosmikus

Component: CompilerCompiler (Type checker)
Type of failure: None/UnknownGHCi crash

comment:2 Changed 22 months ago by simonpj

Resolution: fixed
Status: newclosed

Fixed by

commit 8c3a134045ad4f25080996917b3fe77cb506b17b
Author: Simon Peyton Jones <>
Date:   Wed Jan 31 12:00:43 2018 +0000

    Add missing cases for ForAllPred
    Should fix Trac #14744

comment:3 Changed 18 months ago by RyanGlScott

Keywords: wipT2893 removed
Note: See TracTickets for help on using tickets.