Commit 30c8fb48 authored by Ian Lynagh's avatar Ian Lynagh

Add some tests

parent 90cfe118
......@@ -41,5 +41,6 @@ test('ghci027', normal, ghci_script, ['ghci027.script'])
test('ghci028', normal, ghci_script, ['ghci028.script'])
test('ghci029', normal, ghci_script, ['ghci029.script'])
test('ghci030', expect_broken(2082), ghci_script, ['ghci030.script'])
test('ghci031', expect_broken(2138), ghci_script, ['ghci031.script'])
test('1914', normal, ghci_script, ['1914.script'])
-- Trac #2138
-- If we :i D, we should see the Eq constraint
module Foo where
data Eq a => D a = C a
data Eq a => D a = C a -- Defined at ghci031.hs:6:13
......@@ -72,6 +72,8 @@ clean(['Rn059_A.hi', 'Rn059_A.o', 'Rn059_B.hi', 'Rn059_B.o'])
test('rn060', normal, compile, [''])
test('rn061', normal, compile, [''])
test('rn062', normal, compile, [''])
test('rn063', expect_broken(2136), compile, [''])
test('rn064', if_compiler_ge('ghc', '6.9', expect_broken(2137)), compile, [''])
test('T1972', if_compiler_lt('ghc', '6.9', expect_fail), compile, [''])
......
{-# OPTIONS_GHC -Wall #-}
module Foo where
-- We should complain that both x and y are unused.
-- We used to not warn for recursive bindings, like x (trac #2136).
v :: a
v = let x = x in undefined
w :: a
w = let y = 'a' in undefined
rn063.hs:10:8: Warning: Defined but not used: `x'
rn063.hs:13:8: Warning: Defined but not used: `y'
{-# OPTIONS_GHC -Wall #-}
module Foo where
-- We should complain that the first r shadows the second one, and give
-- the right locations for the two of them. (trac #2137)
z :: a
z = r
where
_a = 'a'
_f r = r
_b = 'b'
r = undefined
_c = 'c'
rn064.hs:13:11:
Warning: This binding for `r' shadows the existing binding
bound at rn064.hs:15:8
In the definition of `_f'
rn064.hs:13:11:
Warning: This binding for `r' shadows an existing binding
In the definition of `_f'
......@@ -258,6 +258,7 @@ test('tc239', extra_clean(['Tc239_Help.hi', 'Tc239_Help.o']),
test('tc240', if_compiler_lt('ghc', '6.9', skip), compile, [''])
test('tc241', normal, compile, [''])
test('tc242', normal, compile, [''])
test('tc243', normal, compile, [''])
test('FD1', normal, compile_fail, [''])
test('FD2', normal, compile_fail, [''])
......
{-# OPTIONS_GHC -Wall #-}
module Bug where
-- When we warn about this, we give a warning saying
-- Inferred type: (.+.) :: forall a. a
-- but we used to not print the parentheses.
(.+.) = undefined
tc243.hs:10:0:
Warning: Definition but no type signature for `.+.'
Inferred type: (.+.) :: forall a. a
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