[GHC] #12430: TypeFamilyDependencies accepts invalid injectivity annotation
GHC
ghc-devs at haskell.org
Mon Oct 15 15:48:02 UTC 2018
#12430: TypeFamilyDependencies accepts invalid injectivity annotation
-------------------------------------+-------------------------------------
Reporter: vagarenko | Owner: (none)
Type: bug | Status: new
Priority: high | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC accepts | Unknown/Multiple
invalid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by monoidal):
Here's a simpler version:
{{{
#!hs
{-# LANGUAGE TypeFamilies, PolyKinds, KindSignatures,
TypeFamilyDependencies,
GADTs, ScopedTypeVariables #-}
module Bug where
import Data.Kind (Type)
data Proxy a
type C a = Int
type family Family (x :: Type) = (y :: Type) | y -> x where
Family x = Proxy (C x)
}}}
`Family` shouldn't be allowed to be injective, it's a constant function:
`Family Int ~ Family Bool`.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12430#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list