Permalink
Browse files

Merge branch 'master' of http://darcs.haskell.org/testsuite

  • Loading branch information...
amosr committed Mar 4, 2013
2 parents bbb619c + 4bd3920 commit 732d6a862fd0da8b93ac405f72fac27f47258ab9
Showing with 270 additions and 146 deletions.
  1. +1 −1 tests/deriving/should_fail/drvfail011.stderr
  2. +11 −11 tests/indexed-types/should_fail/T3330c.stderr
  3. +28 −0 tests/indexed-types/should_fail/T7729.hs
  4. +17 −0 tests/indexed-types/should_fail/T7729.stderr
  5. +28 −0 tests/indexed-types/should_fail/T7729a.hs
  6. +8 −0 tests/indexed-types/should_fail/T7729a.stderr
  7. +3 −1 tests/indexed-types/should_fail/all.T
  8. +1 −1 tests/polykinds/T6068.stdout
  9. +0 −13 tests/safeHaskell/unsafeLibs/Dep01.hs
  10. +0 −4 tests/safeHaskell/unsafeLibs/Dep01.stderr
  11. +0 −16 tests/safeHaskell/unsafeLibs/Dep02.hs
  12. +0 −4 tests/safeHaskell/unsafeLibs/Dep02.stderr
  13. +0 −2 tests/safeHaskell/unsafeLibs/all.T
  14. +14 −0 tests/typecheck/should_compile/T7641.hs
  15. +1 −0 tests/typecheck/should_compile/all.T
  16. +16 −16 tests/typecheck/should_fail/T3950.stderr
  17. +9 −9 tests/typecheck/should_fail/T5570.stderr
  18. +18 −20 tests/typecheck/should_fail/T7368.stderr
  19. +10 −10 tests/typecheck/should_fail/T7368a.stderr
  20. +10 −11 tests/typecheck/should_fail/T7609.stderr
  21. +17 −0 tests/typecheck/should_fail/T7696.hs
  22. +17 −0 tests/typecheck/should_fail/T7696.stderr
  23. +4 −0 tests/typecheck/should_fail/T7697.hs
  24. +4 −0 tests/typecheck/should_fail/T7697.stderr
  25. +5 −0 tests/typecheck/should_fail/T7734.hs
  26. +18 −0 tests/typecheck/should_fail/T7734.stderr
  27. +3 −0 tests/typecheck/should_fail/all.T
  28. +9 −9 tests/typecheck/should_fail/tcfail123.stderr
  29. +9 −9 tests/typecheck/should_fail/tcfail159.stderr
  30. +9 −9 tests/typecheck/should_fail/tcfail200.stderr
@@ -3,7 +3,7 @@ drvfail011.hs:8:1:
No instance for (Eq a) arising from a use of ‛==’
Possible fix: add (Eq a) to the context of the instance declaration
In the expression: ((a1 == b1))
- In an equation for ‛==’: == (T1 a1) (T1 b1) = ((a1 == b1))
+ In an equation for ‛==’: (==) (T1 a1) (T1 b1) = ((a1 == b1))
When typechecking the code for ‛==’
in a standalone derived instance for ‛Eq (T a)’:
To see the code I am typechecking, use -ddump-deriv
@@ -1,11 +1,11 @@
-
-T3330c.hs:23:43:
- Couldn't match kind ‛*’ with ‛* -> *’
- When matching types
- Der ((->) x) :: * -> *
- R :: (* -> *) -> *
- Expected type: Der ((->) x) (f1 x)
- Actual type: R f1
- In the first argument of ‛plug’, namely ‛rf’
- In the first argument of ‛Inl’, namely ‛(plug rf df x)’
- In the expression: Inl (plug rf df x)
+
+T3330c.hs:23:43:
+ Couldn't match kind ‛* -> *’ with ‛*
+ When matching types
+ R :: (* -> *) -> *
+ Der ((->) x) :: * -> *
+ Expected type: Der ((->) x) (f1 x)
+ Actual type: R f1
+ In the first argument of ‛plug’, namely ‛rf’
+ In the first argument of ‛Inl’, namely ‛(plug rf df x)’
+ In the expression: Inl (plug rf df x)
@@ -0,0 +1,28 @@
+{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
+module T7729 where
+
+class Monad m => PrimMonad m where
+ type PrimState m
+
+class MonadTrans t where
+ lift :: Monad m => m a -> t m a
+
+class (PrimMonad (BasePrimMonad m), Monad m) => MonadPrim m where
+ type BasePrimMonad m :: * -> *
+ liftPrim :: BasePrimMonad m a -> m a
+
+
+newtype Rand m a = Rand {
+ runRand :: Maybe (m ()) -> m a
+ }
+
+instance (Monad m) => Monad (Rand m) where
+ return = Rand . const . return
+ (Rand rnd) >>= f = Rand $ \g -> (\x -> runRand (f x) g) =<< rnd g
+
+instance MonadTrans Rand where
+ lift = Rand . const
+
+instance MonadPrim m => MonadPrim (Rand m) where
+ type BasePrimMonad (Rand m) = BasePrimMonad m
+ liftPrim = liftPrim . lift
@@ -0,0 +1,17 @@
+
+T7729.hs:28:14:
+ Could not deduce (BasePrimMonad (Rand m)
+ ~ t0 (BasePrimMonad (Rand m)))
+ from the context (PrimMonad (BasePrimMonad (Rand m)),
+ Monad (Rand m),
+ MonadPrim m)
+ bound by the instance declaration at T7729.hs:26:10-42
+ The type variable ‛t0’ is ambiguous
+ Expected type: t0 (BasePrimMonad (Rand m)) a -> Rand m a
+ Actual type: BasePrimMonad (Rand m) a -> Rand m a
+ Relevant bindings include
+ liftPrim :: BasePrimMonad (Rand m) a -> Rand m a
+ (bound at T7729.hs:28:3)
+ In the first argument of ‛(.)’, namely ‛liftPrim’
+ In the expression: liftPrim . lift
+ In an equation for ‛liftPrim’: liftPrim = liftPrim . lift
@@ -0,0 +1,28 @@
+{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
+module T7729a where
+
+class Monad m => PrimMonad m where
+ type PrimState m
+
+class MonadTrans t where
+ lift :: Monad m => m a -> t m a
+
+class (PrimMonad (BasePrimMonad m), Monad m) => MonadPrim m where
+ type BasePrimMonad m :: * -> *
+ liftPrim :: BasePrimMonad m a -> m a
+
+
+newtype Rand m a = Rand {
+ runRand :: Maybe (m ()) -> m a
+ }
+
+instance (Monad m) => Monad (Rand m) where
+ return = Rand . const . return
+ (Rand rnd) >>= f = Rand $ \g -> (\x -> runRand (f x) g) =<< rnd g
+
+instance MonadTrans Rand where
+ lift = Rand . const
+
+instance MonadPrim m => MonadPrim (Rand m) where
+ type BasePrimMonad (Rand m) = BasePrimMonad m
+ liftPrim x = liftPrim (lift x) -- This line changed from T7729
@@ -0,0 +1,8 @@
+
+T7729a.hs:28:31:
+ Occurs check: cannot construct the infinite type: m0 ~ t0 m0
+ Expected type: m0 a
+ Actual type: BasePrimMonad (Rand m) a
+ In the first argument of ‛lift’, namely ‛x’
+ In the first argument of ‛liftPrim’, namely ‛(lift x)’
+ In the expression: liftPrim (lift x)
@@ -94,4 +94,6 @@ test('T7354a',
['$MAKE -s --no-print-directory T7354a'])
test('T7536', normal, compile_fail, [''])
-test('T7560', normal, compile_fail, [''])
+test('T7560', normal, compile_fail, [''])
+test('T7729', normal, compile_fail, [''])
+test('T7729a', normal, compile_fail, [''])
@@ -1,2 +1,2 @@
exists Nothing
- :: Floop * (KProxy (Maybe *)) a mp => Existential (Maybe *) mp
+ :: Floop * (KProxy (Maybe *)) a kp => Existential (Maybe *) kp
@@ -1,13 +0,0 @@
-module Dep01 where
-
-import Control.Monad
-import Control.Monad.ST
-import Data.STRef
-
-sumST :: Num a => [a] -> IO a
-sumST xs = unsafeSTToIO $ do
- n <- newSTRef 0
- forM_ xs $ \x -> do
- modifySTRef n (+x)
- readSTRef n
-
@@ -1,4 +0,0 @@
-
-Dep01.hs:8:12: Warning:
- In the use of ‛unsafeSTToIO’ (imported from Control.Monad.ST):
- Deprecated: "Please import from Control.Monad.ST.Unsafe instead; This will be removed in the next release"
@@ -1,16 +0,0 @@
-module Dep02 where
-
-import Control.Monad
-import Control.Monad.ST.Lazy
-import Data.STRef.Lazy
-
-sumST :: Num a => [a] -> a
-sumST xs = runST $ do
- n <- newSTRef 0
- forM_ xs $ \x -> do
- modifySTRef n (+x)
- readSTRef n
-
-badST :: ()
-badST = runST $ unsafeIOToST $ putStrLn "Hello World"
-
@@ -1,4 +0,0 @@
-
-Dep02.hs:15:17: Warning:
- In the use of ‛unsafeIOToST’ (imported from Control.Monad.ST.Lazy):
- Deprecated: "Please import from Control.Monad.ST.Lazy.Unsafe instead; This will be removed in the next release"
@@ -10,8 +10,6 @@ def f( name, opts ):
setTestOpts(f)
# Check correct methods are deprecated
-test('Dep01', normal, compile, [''])
-test('Dep02', normal, compile, [''])
test('Dep05', normal, compile_fail, [''])
test('Dep06', normal, compile_fail, [''])
test('Dep07', normal, compile_fail, [''])
@@ -0,0 +1,14 @@
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module T7641 where
+
+data Foo b = Foo deriving Show
+
+class ToFoo a b where
+ toFoo :: a -> Foo b
+
+instance ToFoo (c -> ()) b where
+ toFoo _ = Foo
+
+baz () = toFoo $ \_ -> ()
@@ -397,3 +397,4 @@ test('T7408', normal, compile, [''])
test('UnboxStrictPrimitiveFields', normal, compile, [''])
test('T7541', normal, compile, [''])
test('T7562', normal, compile, [''])
+test('T7641', normal, compile, [''])
@@ -1,16 +1,16 @@
-
-T3950.hs:15:13:
- Couldn't match kind ‛* -> *’ with ‛*
- When matching types
- w :: (* -> * -> *) -> *
- Sealed :: (* -> *) -> *
- Expected type: w (Id p)
- Actual type: Sealed (Id p0 x0)
- In the first argument of ‛Just’, namely ‛rp'’
- In the expression: Just rp'
- In an equation for ‛rp’:
- rp _
- = Just rp'
- where
- rp' :: Sealed (Id p x)
- rp' = undefined
+
+T3950.hs:15:13:
+ Couldn't match kind ‛*’ with ‛* -> *’
+ When matching types
+ Sealed :: (* -> *) -> *
+ w :: (* -> * -> *) -> *
+ Expected type: w (Id p)
+ Actual type: Sealed (Id p0 x0)
+ In the first argument of ‛Just’, namely ‛rp'’
+ In the expression: Just rp'
+ In an equation for ‛rp’:
+ rp _
+ = Just rp'
+ where
+ rp' :: Sealed (Id p x)
+ rp' = undefined
@@ -1,9 +1,9 @@
-
-T5570.hs:7:16:
- Couldn't match kind ‛*’ with ‛#’
- When matching types
- s0 :: *
- Double# :: #
- In the second argument of ‛($)’, namely ‛D# $ 3.0##’
- In the expression: print $ D# $ 3.0##
- In an equation for ‛main’: main = print $ D# $ 3.0##
+
+T5570.hs:7:16:
+ Couldn't match kind ‛#’ with ‛*’
+ When matching types
+ Double# :: #
+ s0 :: *
+ In the second argument of ‛($)’, namely ‛D# $ 3.0##’
+ In the expression: print $ D# $ 3.0##
+ In an equation for ‛main’: main = print $ D# $ 3.0##
@@ -1,20 +1,18 @@
-
-T7368.hs:3:10:
- Couldn't match kind ‛* -> *’ with ‛*’
- When matching types
- c0 :: (* -> *) -> *
- (->) a0 :: * -> *
- Expected type: a0 -> b0
- Actual type: c0 b1
- In the return type of a call of ‛l’
- Probable cause: ‛l’ is applied to too many arguments
- In the first argument of ‛b’, namely ‛(l ())’
- In the expression: b (l ())
-
-T7368.hs:3:13:
- Couldn't match type ‛()’ with ‛b0 a1’
- Expected type: b1 a1
- Actual type: ()
- In the first argument of ‛l’, namely ‛()’
- In the first argument of ‛b’, namely ‛(l ())’
- In the expression: b (l ())
+
+T7368.hs:3:10:
+ Couldn't match kind ‛* -> *’ with ‛*’
+ When matching types
+ b1 :: * -> *
+ b0 :: *
+ Expected type: a0 -> b0
+ Actual type: c0 b1
+ In the return type of a call of ‛l’
+ Probable cause: ‛l’ is applied to too many arguments
+ In the first argument of ‛b’, namely ‛(l ())’
+ In the expression: b (l ())
+
+T7368.hs:3:13:
+ Couldn't match expected type ‛b1 a1’ with actual type ‛()’
+ In the first argument of ‛l’, namely ‛()’
+ In the first argument of ‛b’, namely ‛(l ())’
+ In the expression: b (l ())
@@ -1,10 +1,10 @@
-
-T7368a.hs:8:6:
- Couldn't match kind ‛*’ with ‛* -> *’
- When matching types
- f :: * -> *
- Bad :: (* -> *) -> *
- Expected type: f (Bad f)
- Actual type: Bad t0
- In the pattern: Bad x
- In an equation for ‛fun’: fun (Bad x) = True
+
+T7368a.hs:8:6:
+ Couldn't match kind ‛* -> *’ with ‛*
+ When matching types
+ Bad :: (* -> *) -> *
+ f :: * -> *
+ Expected type: f (Bad f)
+ Actual type: Bad t0
+ In the pattern: Bad x
+ In an equation for ‛fun’: fun (Bad x) = True
@@ -1,11 +1,10 @@
-
-T7609.hs:7:16:
- Expecting one more argument to ‛Maybe’
- The second argument of a tuple should have kind ‛*’,
- but ‛Maybe’ has kind ‛* -> *’
- In the type signature for ‛f’: f :: (a `X` a, Maybe)
-
-T7609.hs:10:19:
- Expecting one more argument to ‛Maybe’
- Expected a type, but ‛Maybe’ has kind ‛* -> *’
- In the type signature for ‛g’: g :: a `X` a => Maybe
+
+T7609.hs:7:16:
+ Expecting one more argument to ‛Maybe’
+ The second argument of a tuple should have kind ‛*’,
+ but ‛Maybe’ has kind ‛* -> *’
+ In the type signature for ‛f’: f :: (a `X` a, Maybe)
+
+T7609.hs:10:7:
+ Expected a constraint, but ‛a `X` a’ has kind ‛*’
+ In the type signature for ‛g’: g :: a `X` a => Maybe
@@ -0,0 +1,17 @@
+module T7696 where
+
+f1 :: (m a, t m)
+f1 = undefined
+
+f2 :: ((), w ())
+f2 = f1
+
+{-
+m :: * -> *
+t :: (* -> *) -> *
+a :: *
+w :: * -> *
+
+m a ~ ()
+t m ~ w ()
+-}
@@ -0,0 +1,17 @@
+
+T7696.hs:7:6:
+ Couldn't match kind ‛* -> *’ with ‛*’
+ When matching types
+ m0 :: * -> *
+ () :: *
+ Expected type: ((), w ())
+ Actual type: (m0 a0, t0 m0)
+ In the expression: f1
+ In an equation for ‛f2’: f2 = f1
+
+T7696.hs:7:6:
+ Couldn't match type ‛m0 a0’ with ‛()’
+ Expected type: ((), w ())
+ Actual type: (m0 a0, t0 m0)
+ In the expression: f1
+ In an equation for ‛f2’: f2 = f1
@@ -0,0 +1,4 @@
+module T7697 where
+
+f :: Int => Int
+f x = x
@@ -0,0 +1,4 @@
+
+T7697.hs:3:6:
+ Expected a constraint, but ‛Int’ has kind ‛*’
+ In the type signature for ‛f’: f :: Int => Int
@@ -0,0 +1,5 @@
+
+module T7734 where
+
+x `f` y = x x
+(&) x y = x x
Oops, something went wrong.

0 comments on commit 732d6a8

Please sign in to comment.