summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T10931.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-04-18 15:14:40 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-04-19 08:38:47 +0100
commit8136a5cbfcd24647f897a2fae9fcbda0b1624035 (patch)
tree8c5c8100cbe1b6552d5fbdd6819c9d4417fac48f /testsuite/tests/indexed-types/should_compile/T10931.hs
parent17eb2419c42c70d7436b6b8cff0cef705353bb4e (diff)
downloadhaskell-8136a5cbfcd24647f897a2fae9fcbda0b1624035.tar.gz
Tighten checking for associated type instances
This patch finishes off Trac #11450. Following debate on that ticket, the patch tightens up the rules for what the instances of an associated type can look like. Now they must match the instance header exactly. Eg class C a b where type T a x b With this class decl, if we have an instance decl instance C ty1 ty2 where ... then the type instance must look like type T ty1 v ty2 = ... with exactly - 'ty1' for 'a' - 'ty2' for 'b', and - a variable for 'x' For example: instance C [p] Int type T [p] y Int = (p,y,y) Previously we allowed multiple instance equations and now, in effect, we don't since they would all overlap. If you want multiple cases, use an auxiliary type family. This is consistent with the treatment of generic-default instances, and the user manual always said "WARNING: this facility (multiple instance equations may be withdrawn in the future". I also improved error messages, and did other minor refactoring.
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/T10931.hs')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T10931.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T10931.hs b/testsuite/tests/indexed-types/should_compile/T10931.hs
index 44e5865177..2c0ea204d3 100644
--- a/testsuite/tests/indexed-types/should_compile/T10931.hs
+++ b/testsuite/tests/indexed-types/should_compile/T10931.hs
@@ -20,6 +20,6 @@ class ( m ~ Outer m (Inner m) ) => BugC (m :: * -> *) where
instance BugC (IdT m) where
type Inner (IdT m) = m
- type Outer (IdT _) = IdT
+ type Outer (IdT m) = IdT
bug f = IdC f