Test Trac #5334, #5331
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 20 Jul 2011 13:47:50 +0000 (14:47 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 20 Jul 2011 13:47:50 +0000 (14:47 +0100)
testsuite/tests/ghc-regress/rename/should_compile/T5331.hs [new file with mode: 0644]
testsuite/tests/ghc-regress/rename/should_compile/T5331.stderr [new file with mode: 0644]
testsuite/tests/ghc-regress/rename/should_compile/T5334.hs [new file with mode: 0644]
testsuite/tests/ghc-regress/rename/should_compile/T5334.stderr [new file with mode: 0644]
testsuite/tests/ghc-regress/rename/should_compile/all.T

diff --git a/testsuite/tests/ghc-regress/rename/should_compile/T5331.hs b/testsuite/tests/ghc-regress/rename/should_compile/T5331.hs
new file mode 100644 (file)
index 0000000..4e7343e
--- /dev/null
@@ -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/testsuite/tests/ghc-regress/rename/should_compile/T5331.stderr b/testsuite/tests/ghc-regress/rename/should_compile/T5331.stderr
new file mode 100644 (file)
index 0000000..36261c5
--- /dev/null
@@ -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/testsuite/tests/ghc-regress/rename/should_compile/T5334.hs b/testsuite/tests/ghc-regress/rename/should_compile/T5334.hs
new file mode 100644 (file)
index 0000000..83f539d
--- /dev/null
@@ -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/testsuite/tests/ghc-regress/rename/should_compile/T5334.stderr b/testsuite/tests/ghc-regress/rename/should_compile/T5334.stderr
new file mode 100644 (file)
index 0000000..de906b9
--- /dev/null
@@ -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}
index 73eda29..3946987 100644 (file)
@@ -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