summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs/should_fail
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-12-22 16:28:50 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2015-12-22 16:35:39 +0000
commit575a98e4d245c1e60526ed6d6711d96cea08e9d2 (patch)
tree34b4945dd5648a47c43d345b787ad151877b7f0b /testsuite/tests/partial-sigs/should_fail
parent01b0461e923788e825392d55d625f70c36ca3c20 (diff)
downloadhaskell-575a98e4d245c1e60526ed6d6711d96cea08e9d2.tar.gz
Refactor named wildcards (again)
Michal's work on #10982, #11098, refactored the handling of named wildcards by making them more like ordinary type variables. This patch takes the same idea to its logical conclusion, resulting in a much tidier, tighter implementation. Read Note [The wildcard story for types] in HsTypes. Changes: * Named wildcards are ordinary type variables, throughout * HsType no longer has a data constructor for named wildcards (was NamedWildCard in HsWildCardInfo). Named wildcards are simply HsTyVars * Similarly named wildcards disappear from Template Haskell * I refactored RnTypes to avoid polluting LocalRdrEnv with something as narrow as named wildcards. Instead the named wildcard set is carried in RnTyKiEnv. There is a submodule update for Haddock.
Diffstat (limited to 'testsuite/tests/partial-sigs/should_fail')
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.hs2
-rw-r--r--testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr16
2 files changed, 12 insertions, 6 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.hs b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.hs
index 28bb8362ce..c9a00f33cc 100644
--- a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.hs
+++ b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE PartialTypeSignatures, NamedWildCards #-}
+{-# LANGUAGE ConstraintKinds, PartialTypeSignatures, NamedWildCards #-}
module NamedExtraConstraintsWildcard where
foo :: (Eq a, _a) => a -> a
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr
index 47e9b99135..bb1a481a1e 100644
--- a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr
+++ b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr
@@ -1,5 +1,11 @@
-
-NamedExtraConstraintsWildcard.hs:4:15: error:
- Named wildcard ‘_a’ not allowed as an extra-contraint
- Use an anonymous wildcard instead
- in the type signature for ‘foo’
+
+NamedExtraConstraintsWildcard.hs:5:1: error:
+ • Could not deduce: t0
+ from the context: (Eq a, t)
+ bound by the inferred type for ‘foo’:
+ (Eq a, t) => a -> a
+ at NamedExtraConstraintsWildcard.hs:5:1-15
+ • In the ambiguity check for the inferred type for ‘foo’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the inferred type
+ foo :: forall a (t :: Constraint). (Eq a, t) => a -> a