[GHC] #15943: "ASSERT failed" with quantified constraints

GHC ghc-devs at haskell.org
Fri Nov 23 21:31:16 UTC 2018


#15943: "ASSERT failed" with quantified constraints
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.3
          Component:  Compiler       |           Version:  8.6.2
           Keywords:                 |  Operating System:  Unknown/Multiple
  QuantifiedConstraints              |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 {-# Language RankNTypes             #-}
 {-# Language DataKinds              #-}
 {-# Language KindSignatures         #-}
 {-# Language PolyKinds              #-}
 {-# Language TypeFamilyDependencies #-}
 {-# Language GADTs                  #-}
 {-# Language TypeSynonymInstances   #-}
 {-# Language FlexibleInstances      #-}
 {-# Language QuantifiedConstraints  #-}

 import Data.Type.Equality
 import Data.Coerce
 import Data.Type.Coercion
 import Data.Kind

 newtype WrapFalse a b = WrapFalse (Hom False a b)
 newtype WrapTrue  a b = WrapTrue  (Hom True  a b)

 class
   (forall (x :: ob) (y :: ob). Coercible (WrapFalse x y) (WrapTrue y x))
   =>
   Ríki ob where

   type Hom (or::Bool) = (res :: ob -> ob -> Type) | res -> or

 instance Ríki Type where
   type Hom False = (->)
   type Hom True  = Op

 newtype Op :: Type -> Type -> Type where
   Op :: (b -> a) -> Op a b
 }}}

 {{{
 $ ghc-stage2 --interactive -ignore-dot-ghci 740_bug.hs
 GHCi, version 8.7.20181029: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Main             ( 740_bug.hs, interpreted )
 *** Exception: ASSERT failed! file compiler/typecheck/TcFlatten.hs, line
 1288
 >
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15943>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list