[commit: testsuite] ghc-7.2: Test Trac #5334, #5331 (dfdc39b)

Ian Lynagh igloo at earth.li
Wed Jul 20 23:24:42 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : ghc-7.2

http://hackage.haskell.org/trac/ghc/changeset/dfdc39b347820c8236cebfdc40b4fd09dcf32eda

>---------------------------------------------------------------

commit dfdc39b347820c8236cebfdc40b4fd09dcf32eda
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jul 20 14:47:50 2011 +0100

    Test Trac #5334, #5331

>---------------------------------------------------------------

 tests/ghc-regress/rename/should_compile/T5331.hs   |   19 +++++++++++++++++++
 .../ghc-regress/rename/should_compile/T5331.stderr |   18 ++++++++++++++++++
 tests/ghc-regress/rename/should_compile/T5334.hs   |   14 ++++++++++++++
 .../ghc-regress/rename/should_compile/T5334.stderr |   13 +++++++++++++
 tests/ghc-regress/rename/should_compile/all.T      |    2 ++
 5 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/tests/ghc-regress/rename/should_compile/T5331.hs b/tests/ghc-regress/rename/should_compile/T5331.hs
new file mode 100644
index 0000000..4e7343e
--- /dev/null
+++ b/tests/ghc-regress/rename/should_compile/T5331.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE GADTs, ScopedTypeVariables #-}
+{-# OPTIONS_GHC -Wall #-}
+
+module Foo where
+
+data T a 
+
+instance Eq (T a)
+{-# SPECIALISE instance forall a.Eq (T Int) #-}
+
+data S = forall a.S1
+
+data W where
+  W1 :: forall a. W
+
+f :: forall a. Int
+f = 3
+
+
diff --git a/tests/ghc-regress/rename/should_compile/T5331.stderr b/tests/ghc-regress/rename/should_compile/T5331.stderr
new file mode 100644
index 0000000..36261c5
--- /dev/null
+++ b/tests/ghc-regress/rename/should_compile/T5331.stderr
@@ -0,0 +1,18 @@
+
+T5331.hs:9:32:
+    Warning: Unused quantified type variable `a'
+             In the type `forall a. Eq (T Int)'
+             In a SPECIALISE instance pragma
+
+T5331.hs:11:17:
+    Warning: Unused quantified type variable `a'
+             In the definition of data constructor `S1'
+
+T5331.hs:14:16:
+    Warning: Unused quantified type variable `a'
+             In the definition of data constructor `W1'
+
+T5331.hs:16:13:
+    Warning: Unused quantified type variable `a'
+             In the type `forall a. Int'
+             In the type signature for `f'
diff --git a/tests/ghc-regress/rename/should_compile/T5334.hs b/tests/ghc-regress/rename/should_compile/T5334.hs
new file mode 100644
index 0000000..83f539d
--- /dev/null
+++ b/tests/ghc-regress/rename/should_compile/T5334.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE RecordWildCards #-}
+
+module T5334 where
+
+data T = T { a, b :: Int }
+
+t = T {..}
+  where
+     a = 1
+     -- b = 2
+
+data S = S { x, y :: Int }
+
+s = S { x = 1 }
diff --git a/tests/ghc-regress/rename/should_compile/T5334.stderr b/tests/ghc-regress/rename/should_compile/T5334.stderr
new file mode 100644
index 0000000..de906b9
--- /dev/null
+++ b/tests/ghc-regress/rename/should_compile/T5334.stderr
@@ -0,0 +1,13 @@
+
+T5334.hs:7:5:
+    Warning: Fields of `T' not initialised: b
+    In the expression: T {..}
+    In an equation for `t':
+        t = T {..}
+          where
+              a = 1
+
+T5334.hs:14:5:
+    Warning: Fields of `S' not initialised: y
+    In the expression: S {x = 1}
+    In an equation for `s': s = S {x = 1}
diff --git a/tests/ghc-regress/rename/should_compile/all.T b/tests/ghc-regress/rename/should_compile/all.T
index 73eda29..3946987 100644
--- a/tests/ghc-regress/rename/should_compile/all.T
+++ b/tests/ghc-regress/rename/should_compile/all.T
@@ -175,3 +175,5 @@ test('T2436',
        extra_clean(['T2436a.hi', 'T2436a.o']) ],
      multimod_compile,
      ['T2436', '-v0'])
+test('T5331', normal, compile, [''])   # Unused tyvar warnings
+test('T5334', normal, compile, [''])   # Unused tyvar warnings





More information about the Cvs-ghc mailing list