Commit e9cb5fef authored by simonpj's avatar simonpj
Browse files

Test for Trac #2334

parent 7d5f8035
{-# LANGUAGE TypeFamilies #-}
-- Trac #2334
module Test where
data family F r
newtype instance F () = F () () deriving Eq
newtype instance F Int = H deriving Eq
data instance F Bool = K1
data instance F Bool = K2
T2334.hs:9:25:
The constructor of a newtype must have exactly one field
but `F' has two
In the definition of data constructor `F'
In the newtype instance declaration for `F'
T2334.hs:10:26:
The constructor of a newtype must have exactly one field
but `H' has none
In the definition of data constructor `H'
In the newtype instance declaration for `F'
T2334.hs:12:14:
Conflicting family instance declarations:
data instance F Bool -- Defined at T2334.hs:12:14
data instance F Bool -- Defined at T2334.hs:13:14
......@@ -26,6 +26,7 @@ test('Simple16', expect_fail, compile_fail, [''])
test('TyFamArity1', normal, compile_fail, [''])
test('TyFamArity2', normal, compile_fail, [''])
test('TyFamUndec', normal, compile_fail, [''])
test('T2334', normal, compile_fail, [''])
test('GADTwrong1', if_compiler_lt('ghc', '6.9', expect_fail), 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