diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-07-10 16:27:14 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-07-10 16:27:14 +0100 |
commit | 547ab6f4595c6d6d6f82ef8a39f6d293380e8dbf (patch) | |
tree | 0f04bd32c6c33cd5aaa4ac87efdcb79c964a4ac8 /testsuite/tests/typecheck | |
parent | c0b66697cafb42390d5eebb1d3d63a2e3fc0110c (diff) | |
parent | 2d47ca445e1be059a9d9882bbccafa3bb415524e (diff) | |
download | haskell-547ab6f4595c6d6d6f82ef8a39f6d293380e8dbf.tar.gz |
Merge branch 'master' of http://darcs.haskell.org/testsuite
Conflicts:
tests/typecheck/should_fail/tcfail181.stderr
Diffstat (limited to 'testsuite/tests/typecheck')
15 files changed, 78 insertions, 62 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T4361.hs b/testsuite/tests/typecheck/should_compile/T4361.hs index 19727c2e53..725d12088e 100644 --- a/testsuite/tests/typecheck/should_compile/T4361.hs +++ b/testsuite/tests/typecheck/should_compile/T4361.hs @@ -17,7 +17,8 @@ upLinSolvRing :: LinSolvRing a => a -> () upLinSolvRing = undefined moduloBasisx :: (LinSolvRing (Pol a), CommutativeRing a) => Pol a -> () -moduloBasisx p = let x = upLinSolvRing p +moduloBasisx p = let x :: () + x = upLinSolvRing p in () -- This is very delicate! The contraint (LinSolvRing (Pol a)) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 86f0e7414c..5a0e36efec 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -355,9 +355,7 @@ test('tc260', normal, compile, ['']) test('tc261', normal, compile, ['']) test('GivenOverlapping', normal, compile, ['']) -test('SilentParametersOverlapping', normal, compile, ['']) test('GivenTypeSynonym', normal, compile, ['']) -test('T5051', normal, compile, ['']) test('T3018', normal, compile, ['']) test('T5032', normal, compile, ['']) test('T2357', normal, compile, ['']) diff --git a/testsuite/tests/typecheck/should_compile/SilentParametersOverlapping.hs b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.hs index 8169c3f64a..44ba7039d9 100644 --- a/testsuite/tests/typecheck/should_compile/SilentParametersOverlapping.hs +++ b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.hs @@ -15,5 +15,5 @@ instance {- silent: C [(a,b)] => -} B [(a,b)] where b x = c [(undefined,undefined)] -- We get wanted: C [(gamma, delta)], -- and gamma,delta are unconstrained - -- But we can apply the C [a] instance without difficulty - -- (except in the old days when we had silent dfun parameters) + -- We can apply the C [a] instance without difficulty, but + -- that fails due to silent dfun parameters diff --git a/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.stderr b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.stderr new file mode 100644 index 0000000000..6a49325e43 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/SilentParametersOverlapping.stderr @@ -0,0 +1,13 @@ + +SilentParametersOverlapping.hs:15:9: + Overlapping instances for C [(t0, t1)] arising from a use of `c' + Matching givens (or their superclasses): + (C [(a, b)]) + bound by the instance declaration + at SilentParametersOverlapping.hs:14:37-45 + Matching instances: + instance C [a] -- Defined at SilentParametersOverlapping.hs:11:10 + (The choice depends on the instantiation of `t0, t1') + In the expression: c [(undefined, undefined)] + In an equation for `b': b x = c [(undefined, undefined)] + In the instance declaration for `B [(a, b)]' diff --git a/testsuite/tests/typecheck/should_compile/T5051.hs b/testsuite/tests/typecheck/should_fail/T5051.hs index e98c074c4b..6c5faf9170 100644 --- a/testsuite/tests/typecheck/should_compile/T5051.hs +++ b/testsuite/tests/typecheck/should_fail/T5051.hs @@ -31,3 +31,4 @@ foo x = x >= x -- This is terribly confusing: the use of (>=) means we need Ord [a], -- and if we have Ord a (which we do) we should be done. -- A very good reason for not having silent parameters! +-- But, alas, we need them! diff --git a/testsuite/tests/typecheck/should_fail/T5051.stderr b/testsuite/tests/typecheck/should_fail/T5051.stderr new file mode 100644 index 0000000000..cebde5c29f --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T5051.stderr @@ -0,0 +1,11 @@ + +T5051.hs:11:11: + Overlapping instances for Eq [a] arising from a use of `>=' + Matching instances: + instance Eq a => Eq [a] -- Defined in `GHC.Classes' + instance [overlap ok] Eq [T] -- Defined at T5051.hs:8:10 + (The choice depends on the instantiation of `a' + To pick the first instance above, use -XIncoherentInstances + when compiling the other instance declarations) + In the expression: x >= x + In an equation for `foo': foo x = x >= x diff --git a/testsuite/tests/typecheck/should_fail/T5691.stderr b/testsuite/tests/typecheck/should_fail/T5691.stderr index 0102aef55a..4e2974485c 100644 --- a/testsuite/tests/typecheck/should_fail/T5691.stderr +++ b/testsuite/tests/typecheck/should_fail/T5691.stderr @@ -6,9 +6,3 @@ T5691.hs:14:9: In the pattern: f :: p a In an equation for `test': test (f :: p a) = MkPRI $ printRule_ f In the instance declaration for `Test PrintRuleInterp' - -T5691.hs:24:10: - No instance for (Monad RecDecParser) - arising from the superclasses of an instance declaration - Possible fix: add an instance declaration for (Monad RecDecParser) - In the instance declaration for `MonadPlus RecDecParser' diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 1884c234e0..0d047bf1ad 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -244,8 +244,10 @@ test('tcfail215', normal, compile_fail, ['']) test('tcfail216', normal, compile_fail, ['']) test('tcfail217', normal, compile_fail, ['']) +test('SilentParametersOverlapping', normal, compile_fail, ['']) test('FailDueToGivenOverlapping', normal, compile_fail, ['']) test('LongWayOverlapping', normal, compile_fail, ['']) +test('T5051', normal, compile_fail, ['']) test('T5236',normal,compile_fail,['']) test('T5246',normal,compile_fail,['']) test('T5300',normal,compile_fail,['']) diff --git a/testsuite/tests/typecheck/should_fail/tcfail019.stderr b/testsuite/tests/typecheck/should_fail/tcfail019.stderr index 0f24d012f6..ac2178be97 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail019.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail019.stderr @@ -4,9 +4,3 @@ tcfail019.hs:18:10: arising from the superclasses of an instance declaration Possible fix: add an instance declaration for (B [a]) In the instance declaration for `D [a]' - -tcfail019.hs:18:10: - No instance for (C [a]) - arising from the superclasses of an instance declaration - Possible fix: add an instance declaration for (C [a]) - In the instance declaration for `D [a]' diff --git a/testsuite/tests/typecheck/should_fail/tcfail041.stderr b/testsuite/tests/typecheck/should_fail/tcfail041.stderr index bfa9de546b..ae8cd47aee 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail041.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail041.stderr @@ -3,10 +3,3 @@ tcfail041.hs:9:10: Unbound implicit parameter (?imp::Int) arising from the superclasses of an instance declaration In the instance declaration for `D Int' - -tcfail041.hs:10:21: - Unbound implicit parameter (?imp::Int) - arising from a use of implicit parameter `?imp' - In the second argument of `(+)', namely `?imp' - In the expression: x + ?imp - In an equation for `methodD': methodD x = x + ?imp diff --git a/testsuite/tests/typecheck/should_fail/tcfail042.stderr b/testsuite/tests/typecheck/should_fail/tcfail042.stderr index ba2b83fd96..76031bb221 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail042.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail042.stderr @@ -7,18 +7,3 @@ tcfail042.hs:15:10: Possible fix: add (Num a) to the context of the instance declaration In the instance declaration for `Bar [a]' - -tcfail042.hs:17:18: - Could not deduce (Num a) arising from a use of `foo' - from the context (Eq a, Show a) - bound by the instance declaration at tcfail042.hs:15:10-34 - Possible fix: - add (Num a) to the context of the instance declaration - In the expression: foo xs - In an equation for `bar': - bar (x : xs) - = foo xs - where - u = x == x - v = show x - In the instance declaration for `Bar [a]' diff --git a/testsuite/tests/typecheck/should_fail/tcfail106.stderr b/testsuite/tests/typecheck/should_fail/tcfail106.stderr index e9de772233..09c09769ba 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail106.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail106.stderr @@ -1,10 +1,4 @@ -tcfail106.hs:11:10: - No instance for (S Int) - arising from the superclasses of an instance declaration - Possible fix: add an instance declaration for (S Int) - In the instance declaration for `C Int' - tcfail106.hs:14:10: No instance for (S Int) arising from the superclasses of an instance declaration diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr index 8110f2e309..690cbe7cf1 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr @@ -1,16 +1,17 @@ -
-tcfail181.hs:17:9:
- Could not deduce (Monad m0) arising from a use of `foo'
- from the context (Monad m)
- bound by the inferred type of
- wog :: Monad m => t -> Something (m Bool) e
- at tcfail181.hs:17:1-30
- The type variable `m0' is ambiguous
- Possible fix: add a type signature that fixes these type variable(s)
- Note: there are several potential instances:
- instance Monad ((->) r) -- Defined in `GHC.Base'
- instance Monad IO -- Defined in `GHC.Base'
- instance Monad [] -- Defined in `GHC.Base'
- In the expression: foo
- In the expression: foo {bar = return True}
- In an equation for `wog': wog x = foo {bar = return True}
+ +tcfail181.hs:17:9: + Could not deduce (Monad m0) arising from a use of `foo' + from the context (Monad m) + bound by the inferred type of + wog :: Monad m => t -> Something (m Bool) e + at tcfail181.hs:17:1-30 + The type variable `m0' is ambiguous + Possible fix: add a type signature that fixes these type variable(s) + Note: there are several potential instances: + instance Monad ((->) r) -- Defined in `GHC.Base' + instance Monad IO -- Defined in `GHC.Base' + instance Monad [] -- Defined in `GHC.Base' + In the expression: foo + In the expression: foo {bar = return True} + In an equation for `wog': wog x = foo {bar = return True} + diff --git a/testsuite/tests/typecheck/should_fail/tcfail189.stderr b/testsuite/tests/typecheck/should_fail/tcfail189.stderr index 6364cc2d5b..96b53e38a5 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail189.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail189.stderr @@ -1,4 +1,33 @@ +tcfail189.hs:9:14: + No instance for (Enum a1) + arising from the arithmetic sequence `1 .. 10' + The type variable `a1' is ambiguous + Possible fix: add a type signature that fixes these type variable(s) + Note: there are several potential instances: + instance Enum Double -- Defined in `GHC.Float' + instance Enum Float -- Defined in `GHC.Float' + instance Integral a => Enum (GHC.Real.Ratio a) + -- Defined in `GHC.Real' + ...plus 7 others + In the expression: [1 .. 10] + In a stmt of a list comprehension: x <- [1 .. 10] + In a stmt of a list comprehension: then group by x using take 2 + +tcfail189.hs:9:15: + No instance for (Num a1) arising from the literal `1' + The type variable `a1' is ambiguous + Possible fix: add a type signature that fixes these type variable(s) + Note: there are several potential instances: + instance Num Double -- Defined in `GHC.Float' + instance Num Float -- Defined in `GHC.Float' + instance Integral a => Num (GHC.Real.Ratio a) + -- Defined in `GHC.Real' + ...plus three others + In the expression: 1 + In the expression: [1 .. 10] + In a stmt of a list comprehension: x <- [1 .. 10] + tcfail189.hs:10:31: Couldn't match type `[a0]' with `a -> a1' Expected type: (a -> a1) -> [a] -> [[a]] diff --git a/testsuite/tests/typecheck/should_run/IPRun.hs b/testsuite/tests/typecheck/should_run/IPRun.hs index 38c47d3bb9..0d2a8d76c6 100644 --- a/testsuite/tests/typecheck/should_run/IPRun.hs +++ b/testsuite/tests/typecheck/should_run/IPRun.hs @@ -11,7 +11,7 @@ f1 = let ?x = 5 in \() -> ?x -- Should always return 5 f2 () = let ?x = 5 in \() -> ?x - -- Inferred type: (Num a, ?x::a) => () -> () -> a + -- Inferred type: Num a => () -> () -> a -- should always return 5 f3 :: () -> ((?x :: Int) => Int) |