Skip to content

Commit

Permalink
Merge branch 'master' of http://darcs.haskell.org/testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Peyton Jones committed Mar 4, 2013
2 parents 3458e25 + 732d6a8 commit 0eaf4a6
Show file tree
Hide file tree
Showing 28 changed files with 306 additions and 107 deletions.
2 changes: 1 addition & 1 deletion tests/deriving/should_fail/drvfail011.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions tests/dph/enumfromto/EnumFromToP.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- List enumeration doesn't work for parallel list comprehensions.
--
-- > ghc-stage2: panic! (the 'impossible' happened)
-- > (GHC version 7.7.20130109 for x86_64-unknown-linux):
-- > DsMonad: uninitialised ds_parr_bi
--
-- (I.enumFromToP is a workaround)

{-# LANGUAGE ParallelArrays, ParallelListComp #-}
{-# OPTIONS -fvectorise #-}
module EnumFromToP where

import Data.Array.Parallel hiding ((+), (-), (*), (/))
import Data.Array.Parallel.PArray
import Data.Array.Parallel.Prelude.Bool as B
import Data.Array.Parallel.Prelude.Double as D
import qualified Data.Array.Parallel.Prelude.Int as I
import qualified Data.Vector as V
import qualified Prelude as P


nums = [: 0 .. 100 :]


3 changes: 3 additions & 0 deletions tests/dph/enumfromto/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
9 changes: 9 additions & 0 deletions tests/dph/enumfromto/dph-enumfromto.T
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test ('EnumFromToP'
, [ extra_clean(['EnumFromToP.o', 'EnumFromToP.hi'])
, reqlib('dph-lifted-vseg')
, reqlib('dph-prim-par')
, ignore_output
, expect_broken(7736)
, only_ways(['normal', 'threaded1', 'threaded2']) ]
, compile_fail
, [ '-O -fno-enable-rewrite-rules -package dph-lifted-vseg'])
22 changes: 11 additions & 11 deletions tests/indexed-types/should_fail/T3330c.stderr
Original file line number Diff line number Diff line change
@@ -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)
28 changes: 28 additions & 0 deletions tests/indexed-types/should_fail/T7729.hs
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions tests/indexed-types/should_fail/T7729.stderr
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions tests/indexed-types/should_fail/T7729a.hs
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions tests/indexed-types/should_fail/T7729a.stderr
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 3 additions & 1 deletion tests/indexed-types/should_fail/all.T
Original file line number Diff line number Diff line change
Expand Up @@ -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, [''])
2 changes: 1 addition & 1 deletion tests/polykinds/T6068.stdout
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
exists Nothing
:: Floop * (KProxy (Maybe *)) a mp => Existential (Maybe *) mp
:: Floop * (KProxy (Maybe *)) a kp => Existential (Maybe *) kp
14 changes: 14 additions & 0 deletions tests/typecheck/should_compile/T7641.hs
Original file line number Diff line number Diff line change
@@ -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 $ \_ -> ()
1 change: 1 addition & 0 deletions tests/typecheck/should_compile/all.T
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,4 @@ test('T7408', normal, compile, [''])
test('UnboxStrictPrimitiveFields', normal, compile, [''])
test('T7541', normal, compile, [''])
test('T7562', normal, compile, [''])
test('T7641', normal, compile, [''])
32 changes: 16 additions & 16 deletions tests/typecheck/should_fail/T3950.stderr
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions tests/typecheck/should_fail/T5570.stderr
Original file line number Diff line number Diff line change
@@ -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##
38 changes: 18 additions & 20 deletions tests/typecheck/should_fail/T7368.stderr
Original file line number Diff line number Diff line change
@@ -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 ())
20 changes: 10 additions & 10 deletions tests/typecheck/should_fail/T7368a.stderr
Original file line number Diff line number Diff line change
@@ -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
21 changes: 10 additions & 11 deletions tests/typecheck/should_fail/T7609.stderr
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions tests/typecheck/should_fail/T7696.hs
Original file line number Diff line number Diff line change
@@ -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 ()
-}
17 changes: 17 additions & 0 deletions tests/typecheck/should_fail/T7696.stderr
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests/typecheck/should_fail/T7697.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module T7697 where

f :: Int => Int
f x = x
4 changes: 4 additions & 0 deletions tests/typecheck/should_fail/T7697.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

T7697.hs:3:6:
Expected a constraint, but ‛Int’ has kind ‛*’
In the type signature for ‛f’: f :: Int => Int
5 changes: 5 additions & 0 deletions tests/typecheck/should_fail/T7734.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

module T7734 where

x `f` y = x x
(&) x y = x x
18 changes: 18 additions & 0 deletions tests/typecheck/should_fail/T7734.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

T7734.hs:4:13:
Occurs check: cannot construct the infinite type: t2 ~ t2 -> t1
Relevant bindings include
f :: (t2 -> t1) -> t -> t1 (bound at T7734.hs:4:1)
x :: t2 -> t1 (bound at T7734.hs:4:1)
In the first argument of ‛x’, namely ‛x’
In the expression: x x
In an equation for ‛f’: x `f` y = x x

T7734.hs:5:13:
Occurs check: cannot construct the infinite type: t2 ~ t2 -> t1
Relevant bindings include
& :: (t2 -> t1) -> t -> t1 (bound at T7734.hs:5:1)
x :: t2 -> t1 (bound at T7734.hs:5:5)
In the first argument of ‛x’, namely ‛x’
In the expression: x x
In an equation for ‛&’: (&) x y = x x
Loading

0 comments on commit 0eaf4a6

Please sign in to comment.