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

#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

#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 Resolution: | Keywords: | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): It works if we replace `(->)` with the representationally equal `Fun` {{{#!hs newtype Fun a b = Fun (a -> b) instance Ríki Type where type Hom False = Fun type Hom True = Op }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15943#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 Resolution: | Keywords: | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Seems ok with HEAD, happily. Do you agree? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15943#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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
Resolution: | Keywords:
| QuantifiedConstraints
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#15943: "ASSERT failed" with quantified constraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: fixed | Keywords: | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed Comment: I'm going to declare this fixed. In an ideal world I'd track down the original cause, but life is short. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15943#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC