summaryrefslogtreecommitdiff
path: root/testsuite/tests/generics
diff options
context:
space:
mode:
authorRyanGlScott <ryan.gl.scott@gmail.com>2016-04-10 22:59:37 +0200
committerBen Gamari <ben@smart-cactus.org>2016-04-10 23:41:16 +0200
commit7443e5c8dae24b83f5f4975c7accce02b819029c (patch)
tree80d9030b79ca386636916fc9f7a2cdd629d437d0 /testsuite/tests/generics
parentad532ded871a9a5180388a2b7cdbdc26e053284c (diff)
downloadhaskell-7443e5c8dae24b83f5f4975c7accce02b819029c.tar.gz
Remove the instantiation check when deriving Generic(1)
Previously, deriving `Generic(1)` bailed out when attempting to instantiate visible type parameters (#5939), but this instantiation check was quite fragile and doesn't interact well with `-XTypeInType`. It has been decided that `Generic(1)` shouldn't be subjected to this check anyway, so it has been removed, and `gen_Generic_binds`'s machinery has been updated to substitute the type variables in a generated `Rep`/`Rep1` instance with the user-supplied type arguments. In addition, this also refactors `Condition` in `TcDeriv` a bit. Namely, since we no longer need `tc_args` to check any conditions, the `[Type]` component of `Condition` has been removed. Fixes #11732. Test Plan: ./validate Reviewers: goldfire, kosmikus, simonpj, bgamari, austin Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2061 GHC Trac Issues: #5939, #11732
Diffstat (limited to 'testsuite/tests/generics')
-rw-r--r--testsuite/tests/generics/GenCannotDoRep0_0.stderr30
1 files changed, 10 insertions, 20 deletions
diff --git a/testsuite/tests/generics/GenCannotDoRep0_0.stderr b/testsuite/tests/generics/GenCannotDoRep0_0.stderr
index e1292b8e7e..be649e0d46 100644
--- a/testsuite/tests/generics/GenCannotDoRep0_0.stderr
+++ b/testsuite/tests/generics/GenCannotDoRep0_0.stderr
@@ -1,24 +1,14 @@
-GenCannotDoRep0_0.hs:6:14: Warning:
+GenCannotDoRep0_0.hs:6:14: warning:
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
-GenCannotDoRep0_0.hs:13:45:
- Can't make a derived instance of ‘Generic Dynamic’:
- Constructor ‘Dynamic’ has existentials or constraints in its type
- Possible fix: use a standalone deriving declaration instead
- In the data declaration for ‘Dynamic’
+GenCannotDoRep0_0.hs:13:45: error:
+ • Can't make a derived instance of ‘Generic Dynamic’:
+ Constructor ‘Dynamic’ has existentials or constraints in its type
+ Possible fix: use a standalone deriving declaration instead
+ • In the data declaration for ‘Dynamic’
-GenCannotDoRep0_0.hs:17:1:
- Can't make a derived instance of ‘Generic (P Int)’:
- P must not be instantiated; try deriving `P a' instead
- In the stand-alone deriving instance for ‘Generic (P Int)’
-
-GenCannotDoRep0_0.hs:26:1:
- Can't make a derived instance of ‘Generic (D Char Char)’:
- D must not be instantiated; try deriving `D Char b' instead
- In the stand-alone deriving instance for ‘Generic (D Char Char)’
-
-GenCannotDoRep0_0.hs:28:1:
- Can't make a derived instance of ‘Generic (D Int a)’:
- D must not have a datatype context
- In the stand-alone deriving instance for ‘Generic (D Int a)’
+GenCannotDoRep0_0.hs:28:1: error:
+ • Can't make a derived instance of ‘Generic (D Int a)’:
+ D must not have a datatype context
+ • In the stand-alone deriving instance for ‘Generic (D Int a)’