[commit: ghc] master: Add regression test for unused implicit parameter warning (#10632) (9834fea)

git at git.haskell.org git at git.haskell.org
Mon Jul 20 02:35:55 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9834fea4d8fa00eb55f864287aa323ec7412e578/ghc

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

commit 9834fea4d8fa00eb55f864287aa323ec7412e578
Author: Reid Barton <rwbarton at gmail.com>
Date:   Sun Jul 19 22:36:08 2015 -0400

    Add regression test for unused implicit parameter warning (#10632)


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

9834fea4d8fa00eb55f864287aa323ec7412e578
 testsuite/tests/typecheck/should_compile/T10632.hs     | 7 +++++++
 testsuite/tests/typecheck/should_compile/T10632.stderr | 4 ++++
 testsuite/tests/typecheck/should_compile/all.T         | 1 +
 3 files changed, 12 insertions(+)

diff --git a/testsuite/tests/typecheck/should_compile/T10632.hs b/testsuite/tests/typecheck/should_compile/T10632.hs
new file mode 100644
index 0000000..5c1a177
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10632.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE ImplicitParams #-}
+
+f :: (?file1 :: String) => IO ()
+f = putStrLn $ "f2: "
+
+main :: IO ()
+main = let ?file1 = "A" in f
diff --git a/testsuite/tests/typecheck/should_compile/T10632.stderr b/testsuite/tests/typecheck/should_compile/T10632.stderr
new file mode 100644
index 0000000..81377b3
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10632.stderr
@@ -0,0 +1,4 @@
+
+T10632.hs:3:6: warning:
+    Redundant constraint: ?file1::String
+    In the type signature for: f :: (?file1::String) => IO ()
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 5674d87..db9ad0e 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -466,4 +466,5 @@ test('T10428', normal, compile, [''])
 test('RepArrow', normal, compile, [''])
 test('T10562', normal, compile, [''])
 test('T10564', normal, compile, [''])
+test('T10632', normal, compile, [''])
 test('T10642', normal, compile, [''])



More information about the ghc-commits mailing list