Add regression test for unused implicit parameter warning (#10632)
authorReid Barton <rwbarton@gmail.com>
Mon, 20 Jul 2015 02:36:08 +0000 (22:36 -0400)
committerReid Barton <rwbarton@gmail.com>
Mon, 20 Jul 2015 02:36:08 +0000 (22:36 -0400)
testsuite/tests/typecheck/should_compile/T10632.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T10632.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T

diff --git a/testsuite/tests/typecheck/should_compile/T10632.hs b/testsuite/tests/typecheck/should_compile/T10632.hs
new file mode 100644 (file)
index 0000000..5c1a177
--- /dev/null
@@ -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 (file)
index 0000000..81377b3
--- /dev/null
@@ -0,0 +1,4 @@
+
+T10632.hs:3:6: warning:
+    Redundant constraint: ?file1::String
+    In the type signature for: f :: (?file1::String) => IO ()
index 5674d87..db9ad0e 100644 (file)
@@ -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, [''])