summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T9582.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-03-04 11:59:47 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2015-03-04 12:00:21 +0000
commitf66e0e695b0377c469fbe877d4850fc0ebca2010 (patch)
treef20d6e81e1d79e3e1d6e6cff923203e460f73d96 /testsuite/tests/indexed-types/should_compile/T9582.hs
parentd058bc9ce04e8397c8fd0a32a8654b83f3ef4af1 (diff)
downloadhaskell-f66e0e695b0377c469fbe877d4850fc0ebca2010.tar.gz
A raft of small changes associated with -XConstrainedClassMethods
See Trac #7854. Specifically: * Major clean up and simplification of check_op in checkValidClass; specifically - use checkValidType on the entire method-selector type to detect ambiguity - put a specific test for -XConstrainedClassMethods * Make -XConstrainedClassMethods be implied by -XMultiParamTypeClasses (a bit ad-hoc but see #7854), and document in the user manual. * Do the checkAmbiguity test just once in TcValidity.checkValidType, rather than repeatedly at every level. See Note [When to call checkAmbiguity] * Add -XAllowAmbiguousTypes in GHC.IP, since 'ip' really is ambiguous. (It's a rather magic function.) * Improve location info for check_op in checkValidClass * Update quite a few tests, which had genuinely-ambiguous class method signatures. Some I fixed by making them unambiguous; some by adding -XAllowAmbiguousTypes
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/T9582.hs')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T9582.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T9582.hs b/testsuite/tests/indexed-types/should_compile/T9582.hs
index f86d723319..d906205834 100644
--- a/testsuite/tests/indexed-types/should_compile/T9582.hs
+++ b/testsuite/tests/indexed-types/should_compile/T9582.hs
@@ -3,12 +3,12 @@ module T9582 where
class C a where
type T a
- m :: T a
+ m :: a -> T a
instance C Int where
type T Int = String
- m :: String
- m = "bla"
+ m :: Int -> String
+ m _ = "bla"
-- Method signature does not match class; it should be m :: T Int
-- In the instance declaration for ‘C Int’