summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2017-08-12 15:46:44 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2017-08-12 15:46:44 -0400
commit3f05e5f6becc2f7174898726b6f027105b12a780 (patch)
tree54189ff786c9f176db04ab575590f3d2a8514792 /testsuite
parenta4f347c23ed926c24d178fec54c27d94f1fae0e4 (diff)
downloadhaskell-3f05e5f6becc2f7174898726b6f027105b12a780.tar.gz
Don't suppress unimplemented type family warnings with DeriveAnyClass
Summary: For some asinine reason, we were suppressing warnings when deriving associated type family instances with `DeriveAnyClass`. That seems like a bad idea. Let's not do that. Along the way, I noticed that the error contexts associated with these newly emitted warnings were less than ideal, so I did some minor refactoring to improve the story there. Fixes #14094 Test Plan: ./validate Reviewers: bgamari, austin Subscribers: rwbarton, thomie GHC Trac Issues: #14094 Differential Revision: https://phabricator.haskell.org/D3828
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/deriving/should_compile/T14094.hs13
-rw-r--r--testsuite/tests/deriving/should_compile/T14094.stderr26
-rw-r--r--testsuite/tests/deriving/should_compile/all.T1
-rw-r--r--testsuite/tests/deriving/should_fail/T10598_fail3.stderr7
-rw-r--r--testsuite/tests/deriving/should_fail/T8165_fail2.stderr7
5 files changed, 47 insertions, 7 deletions
diff --git a/testsuite/tests/deriving/should_compile/T14094.hs b/testsuite/tests/deriving/should_compile/T14094.hs
new file mode 100644
index 0000000000..29fa693e97
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T14094.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE DeriveAnyClass #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# OPTIONS_GHC -Wall #-}
+module Bug where
+
+class C a where
+ type T a
+ data D a
+ m :: a
+
+instance C Int
+deriving instance C Bool
diff --git a/testsuite/tests/deriving/should_compile/T14094.stderr b/testsuite/tests/deriving/should_compile/T14094.stderr
new file mode 100644
index 0000000000..b323a775f5
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T14094.stderr
@@ -0,0 +1,26 @@
+
+T14094.hs:12:1: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit associated type or default declaration for ‘T’
+ • In the instance declaration for ‘C Int’
+
+T14094.hs:12:1: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit associated type or default declaration for ‘D’
+ • In the instance declaration for ‘C Int’
+
+T14094.hs:12:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘m’
+ • In the instance declaration for ‘C Int’
+
+T14094.hs:13:1: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit associated type or default declaration for ‘T’
+ • In the instance declaration for ‘C Bool’
+
+T14094.hs:13:1: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit associated type or default declaration for ‘D’
+ • In the instance declaration for ‘C Bool’
+
+T14094.hs:13:1: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘m’
+ • In the instance declaration for ‘C Bool’
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index 5b69565c52..65c6d7284e 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -95,3 +95,4 @@ test('T13813', normal, compile, [''])
test('T13919', normal, compile, [''])
test('T13998', normal, compile, [''])
test('T14045b', normal, compile, [''])
+test('T14094', normal, compile, [''])
diff --git a/testsuite/tests/deriving/should_fail/T10598_fail3.stderr b/testsuite/tests/deriving/should_fail/T10598_fail3.stderr
index a987a4993d..c3f4e123b7 100644
--- a/testsuite/tests/deriving/should_fail/T10598_fail3.stderr
+++ b/testsuite/tests/deriving/should_fail/T10598_fail3.stderr
@@ -1,5 +1,4 @@
-T10598_fail3.hs:1:1: error:
- Generic instances can only be derived in Safe Haskell using the stock strategy.
- In the following instance:
- instance [safe] Generic T
+T10598_fail3.hs:8:36: error:
+ • Generic instances can only be derived in Safe Haskell using the stock strategy.
+ • In the instance declaration for ‘Generic T’
diff --git a/testsuite/tests/deriving/should_fail/T8165_fail2.stderr b/testsuite/tests/deriving/should_fail/T8165_fail2.stderr
index 4c925f52a3..5e19173a33 100644
--- a/testsuite/tests/deriving/should_fail/T8165_fail2.stderr
+++ b/testsuite/tests/deriving/should_fail/T8165_fail2.stderr
@@ -1,5 +1,6 @@
T8165_fail2.hs:9:12: error:
- The type family application ‘T Loop’
- is no smaller than the instance head
- (Use UndecidableInstances to permit this)
+ • The type family application ‘T Loop’
+ is no smaller than the instance head
+ (Use UndecidableInstances to permit this)
+ • In the instance declaration for ‘C Loop’