[GHC] #15052: DeriveAnyClass instances may skip TypeError constraints
GHC
ghc-devs at haskell.org
Wed Apr 18 10:59:36 UTC 2018
#15052: DeriveAnyClass instances may skip TypeError constraints
-------------------------------------+-------------------------------------
Reporter: jcpetruzza | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler | Version: 8.2.2
Resolution: | Keywords:
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 jcpetruzza):
Sorry that I wasn't clear. I meant, using `instance` and `deriving
instance` without providing the instance head.
{{{#!haskell
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UndecidableSuperClasses #-}
module T where
import GHC.TypeLits(TypeError, ErrorMessage(..))
class TypeError ('Text "BOOM") => C a where
f :: a -> ()
f _ = ()
data T1 = T1
deriving C
data T2 = T2
instance C T2 -- won't typecheck
data T3 = T3
deriving instance C T3 -- won't typecheck
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15052#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list