Commit 15a00f78 authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

Adapt indexed type tests to removal of newtype families

parent ac9c2425
......@@ -16,12 +16,12 @@ instance Eq (T Char) where
C == C = False
newtype family S a
data family S a
newtype instance S Int = S Int
deriving Eq
newtype family S2 a b
data family S2 a b
newtype instance S2 Int b = S2 (IO b)
deriving Monad
......
......@@ -3,9 +3,9 @@
module ShouldCompile where
class C a where
data Sd a :: *
newtype Sn a :: *
type St a :: *
data Sd a :: *
data Sn a :: *
type St a :: *
instance C Int where
data Sd Int = SdC Char
......
......@@ -3,8 +3,8 @@
module ShouldCompile where
class C3 a where
data S3 a -- kind is optional
newtype S3n a -- kind is optional
data S3 a -- kind is optional
data S3n a -- kind is optional
foo3 :: a -> S3 a
foo3n :: a -> S3n a
bar3 :: S3 a -> a
......
{-# OPTIONS -findexed-types #-}
module ShouldFail where
module ShouldCompile where
class C1 a where
newtype S1 a :: *
data S1 a :: *
-- must fail: wrong category of type instance
-- instance of data families can be data or newtypes
instance C1 Char where
data S1 Char = S1Char ()
newtype S1 Char = S1Char ()
......@@ -7,6 +7,7 @@ test('Simple3', normal, compile, [''])
test('Simple4', normal, compile, [''])
test('Simple5', normal, compile, [''])
test('Simple6', normal, compile, [''])
test('Simple7', normal, compile, [''])
test('ind1', normal, compile, [''])
test('ind2', normal, multimod_compile, ['ind2', '-v0'])
......
......@@ -3,9 +3,9 @@
module Simple2a where
class C a where
data Sd a :: *
newtype Sn a :: *
type St a :: *
data Sd a :: *
data Sn a :: *
type St a :: *
instance C Int where
data Sd a :: * -- must fail: parse error
......
{-# OPTIONS -findexed-types #-}
class C a where
data Sd a :: *
newtype Sn a :: *
type St a :: *
data Sd a :: *
data Sn a :: *
type St a :: *
instance C Int where
data Sd Int = SdC1 Char -- must fail: conflicting
......
......@@ -3,7 +3,7 @@
module ShouldFail where
class C1 a where
newtype S1 a :: *
data S1 a :: *
-- must fail: wrong category of type instance
instance C1 Int where
......
Simple3a.hs:10:2:
Wrong category of family instance; declaration was for a newtype
Wrong category of family instance; declaration was for a data type
......@@ -4,7 +4,7 @@ module ShouldFail where
class C3 a where
data S3 a :: *
newtype S3n a :: *
data S3n a :: *
foo3 :: a -> S3 a
foo3n :: a -> S3n a
bar3 :: S3 a -> a
......
......@@ -4,7 +4,7 @@ module ShouldFail where
class C3 a where
data S3 a :: *
newtype S3n a :: *
data S3n a :: *
foo3 :: a -> S3 a
foo3n :: a -> S3n a
bar3 :: S3 a -> a
......
......@@ -6,7 +6,6 @@ test('Simple1b', normal, compile_fail, [''])
test('Simple2a', normal, compile_fail, [''])
test('Simple2b', normal, compile_fail, [''])
test('Simple3a', normal, compile_fail, [''])
test('Simple3b', normal, compile_fail, [''])
test('Simple4', normal, compile_fail, [''])
test('Simple5a', normal, compile_fail, [''])
test('Simple5b', 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