Commit cf86ebae authored by Simon Peyton Jones's avatar Simon Peyton Jones

Add tests for type signature validity (cf Trac 2019)

parent b3f489fd
......@@ -182,4 +182,7 @@ test('tcfail190', if_compiler_lt('ghc', '6.9', skip), compile_fail, [''])
test('tcfail191', if_compiler_lt('ghc', '6.9', skip), compile_fail, [''])
test('tcfail192', if_compiler_lt('ghc', '6.9', skip), compile_fail, [''])
test('tcfail193', if_compiler_lt('ghc', '6.9', skip), compile_fail, [''])
test('tcfail194', if_compiler_lt('ghc', '6.9', skip), compile_fail, [''])
\ No newline at end of file
test('tcfail194', if_compiler_lt('ghc', '6.9', skip), compile_fail, [''])
test('tcfail195', normal, compile_fail, [''])
test('tcfail196', normal, compile_fail, [''])
test('tcfail197', normal, compile_fail, [''])
tcfail127.hs:3:0:
All of the type variables in the constraint `Num a'
are already in scope (at least one must be universally quantified here)
(Use -XFlexibleContexts to lift this restriction)
Illegal polymorphic or qualified type: (Num a) => a -> a
In the type signature for `foo':
foo :: IO ((Num a) => a -> a)
{-# LANGUAGE RankNTypes, GADTs #-}
module ShouldFail where
data Foo a where
Foo :: Int -> Foo (forall a. a)
tcfail195.hs:6:2:
Illegal polymorphic or qualified type: forall a. a
In the definition of data constructor `Foo'
In the data type declaration for `Foo'
{-# LANGUAGE RankNTypes #-}
module ShouldFail where
bar :: Num (forall a. a) => Int -> Int
bar = error "urk"
tcfail196.hs:5:0:
Illegal polymorphic or qualified type: forall a. a
In the type signature for `bar':
bar :: (Num (forall a. a)) => Int -> Int
{-# LANGUAGE RankNTypes #-}
module ShouldFail where
foo :: [forall a. a] -> Int
foo = error "urk"
tcfail197.hs:5:0:
Illegal polymorphic or qualified type: forall a. a
In the type signature for `foo':
foo :: [forall a. a] -> Int
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