Commit 4cba0297 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Add tests for deriving Typable on data families

parent d6bc56c0
......@@ -5,7 +5,6 @@ T2604.hs:7:35:
In the data type declaration for `DList'
T2604.hs:9:38:
Can't make a derived instance of `Typeable (NList a)'
(even with cunning newtype deriving):
Can't make a derived instance of `Typeable (NList a)':
You need -XDeriveDataTypeable to derive an instance for this class
In the newtype declaration for `NList'
drvfail015.hs:10:19:
Illegal instance declaration for `Eq T'
(All instance types must be of the form (T t1 ... tn)
where T is not a synonym.
Use -XTypeSynonymInstances if you want to disable this.)
In the stand-alone deriving instance for `Eq T'
drvfail015.hs:13:1:
The data constructors of `Handle' are not all in scope
so you cannot derive an instance for it
In the stand-alone deriving instance for `Eq Handle'
drvfail015.hs:10:19:
Illegal instance declaration for `Eq T'
(All instance types must be of the form (T t1 ... tn)
where T is not a synonym.
Use -XTypeSynonymInstances if you want to disable this.)
In the stand-alone deriving instance for `Eq T'
drvfail015.hs:13:1:
Can't make a derived instance of `Eq Handle':
The data constructors of `Handle' are not all in scope
so you cannot derive an instance for it
In the stand-alone deriving instance for `Eq Handle'
{-# LANGUAGE TypeFamilies, StandaloneDeriving, DeriveDataTypeable, FlexibleInstances #-}
module T1769 where
import Data.Typeable
data family T a
deriving instance Typeable1 T
-- deriving instance Functor T
data instance T [b] = T1 | T2 b
deriving instance Eq b => Eq (T [b])
......@@ -160,3 +160,4 @@ test('T4484', normal, compile, [''])
test('T4492', normal, compile, [''])
test('T4494', normal, compile, [''])
test('DataFamDeriv', normal, compile, [''])
test('T1769', normal, compile, [''])
{-# LANGUAGE TypeFamilies, StandaloneDeriving #-}
-- Crashed 6.12
module T1769 where
data family T a
deriving instance Functor T
DerivUnsatFam.hs:8:1:
Can't make a derived instance of `Functor T':
Unsaturated data family application
In the stand-alone deriving instance for `Functor T'
......@@ -65,4 +65,5 @@ test('T2239', normal, compile_fail, [''])
test('T3440', normal, compile_fail, [''])
test('T4485', normal, compile_fail, [''])
test('T4174', normal, compile_fail, [''])
test('DerivUnsatFam', normal, compile_fail, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment