diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-06-11 23:49:27 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-06-13 10:57:03 +0100 |
commit | 15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72 (patch) | |
tree | e2e7336c63e9b7130ba70f3551ff290d4a25184b /testsuite/tests/partial-sigs/should_fail | |
parent | d25cb61a1c2a135a2564143a332f8b2962f134bc (diff) | |
download | haskell-15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72.tar.gz |
Improve typechecking of let-bindings
This major commit was initially triggered by #11339, but it spiraled
into a major review of the way in which type signatures for bindings
are handled, especially partial type signatures. On the way I fixed a
number of other bugs, namely
#12069
#12033
#11700
#11339
#11670
The main change is that I completely reorganised the way in which type
signatures in bindings are handled. The new story is in TcSigs
Note [Overview of type signatures]. Some specific:
* Changes in the data types for signatures in TcRnTypes:
TcIdSigInfo and new TcIdSigInst
* New module TcSigs deals with typechecking type signatures
and pragmas. It contains code mostly moved from TcBinds,
which is already too big
* HsTypes: I swapped the nesting of HsWildCardBndrs
and HsImplicitBndsrs, so that the wildcards are on the
oustide not the insidde in a LHsSigWcType. This is just
a matter of convenient, nothing deep.
There are a host of other changes as knock-on effects, and
it all took FAR longer than I anticipated :-). But it is
a significant improvement, I think.
Lots of error messages changed slightly, some just variants but
some modest improvements.
New tests
* typecheck/should_compile
* SigTyVars: a scoped-tyvar test
* ExPat, ExPatFail: existential pattern bindings
* T12069
* T11700
* T11339
* partial-sigs/should_compile
* T12033
* T11339a
* T11670
One thing to check:
* Small change to output from ghc-api/landmines.
Need to check with Alan Zimmerman
Diffstat (limited to 'testsuite/tests/partial-sigs/should_fail')
22 files changed, 420 insertions, 422 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr b/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr index 460bc63a44..98fd37770b 100644 --- a/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr +++ b/testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr @@ -1,7 +1,4 @@ - -Defaulting1MROff.hs:7:10: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘Integer’ - • In the type signature: - alpha :: _ - • Relevant bindings include - alpha :: Integer (bound at Defaulting1MROff.hs:8:1) +
+Defaulting1MROff.hs:7:10: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Integer’
+ • In the type signature: alpha :: _
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs index 8a7ce369e8..ed653c1f64 100644 --- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs +++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE PartialTypeSignatures #-} + module ExtraConstraintsWildcardInExpressionSignature where foo x y = ((==) :: _ => _) x y diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr index 9f04fc2cf2..b634ec4eb7 100644 --- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr +++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr @@ -1,4 +1,32 @@ - -ExtraConstraintsWildcardInExpressionSignature.hs:3:20: error: - Extra-constraint wildcard ‘_’ not allowed - in an expression type signature +
+ExtraConstraintsWildcardInExpressionSignature.hs:5:20: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Eq a1’
+ Where: ‘a1’ is a rigid type variable bound by
+ the inferred type of <expression> :: Eq a1 => a1 -> a1 -> Bool
+ at ExtraConstraintsWildcardInExpressionSignature.hs:5:20-25
+ • In an expression type signature: _ => _
+ In the expression: (==) :: _ => _
+ In the expression: ((==) :: _ => _) x y
+ • Relevant bindings include
+ y :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:7)
+ x :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:5)
+ foo :: a -> a -> Bool
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:1)
+
+ExtraConstraintsWildcardInExpressionSignature.hs:5:25: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘a1 -> a1 -> Bool’
+ Where: ‘a1’ is a rigid type variable bound by
+ the inferred type of <expression> :: Eq a1 => a1 -> a1 -> Bool
+ at ExtraConstraintsWildcardInExpressionSignature.hs:5:20-25
+ • In an expression type signature: _ => _
+ In the expression: (==) :: _ => _
+ In the expression: ((==) :: _ => _) x y
+ • Relevant bindings include
+ y :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:7)
+ x :: a
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:5)
+ foo :: a -> a -> Bool
+ (bound at ExtraConstraintsWildcardInExpressionSignature.hs:5:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr index d1dee083dd..0790605837 100644 --- a/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr +++ b/testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr @@ -1,6 +1,8 @@ - -ExtraConstraintsWildcardNotEnabled.hs:4:10: error: - Found constraint wildcard ‘_’ standing for ‘Show a’ - To use the inferred type, enable PartialTypeSignatures - In the type signature: - show' :: _ => a -> String +
+ExtraConstraintsWildcardNotEnabled.hs:4:10: error:
+ • Found type wildcard ‘_’ standing for ‘Show a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of show' :: Show a => a -> String
+ at ExtraConstraintsWildcardNotEnabled.hs:5:1-16
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: show' :: _ => a -> String
diff --git a/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr b/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr index 2df15443c9..ed33f25d47 100644 --- a/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr +++ b/testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr @@ -1,18 +1,16 @@ - -InstantiatedNamedWildcardsInConstraints.hs:4:14: error: - • Found type wildcard ‘_a’ standing for ‘b’ - Where: ‘b’ is a rigid type variable bound by - the inferred type of foo :: (Enum b, Show b) => b -> (String, b) - at InstantiatedNamedWildcardsInConstraints.hs:4:8 - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - foo :: (Enum _a, _) => _a -> (String, b) - • Relevant bindings include - foo :: b -> (String, b) - (bound at InstantiatedNamedWildcardsInConstraints.hs:5:1) - -InstantiatedNamedWildcardsInConstraints.hs:4:18: error: - Found constraint wildcard ‘_’ standing for ‘Show b’ - To use the inferred type, enable PartialTypeSignatures - In the type signature: - foo :: (Enum _a, _) => _a -> (String, b) +
+InstantiatedNamedWildcardsInConstraints.hs:4:14: error:
+ • Found type wildcard ‘_a’ standing for ‘b’
+ Where: ‘b’ is a rigid type variable bound by
+ the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
+ at InstantiatedNamedWildcardsInConstraints.hs:5:1-26
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Enum _a, _) => _a -> (String, b)
+
+InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
+ • Found type wildcard ‘_’ standing for ‘Show b’
+ Where: ‘b’ is a rigid type variable bound by
+ the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
+ at InstantiatedNamedWildcardsInConstraints.hs:5:1-26
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Enum _a, _) => _a -> (String, b)
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr index 5d95186909..0019ec85da 100644 --- a/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr +++ b/testsuite/tests/partial-sigs/should_fail/NamedExtraConstraintsWildcard.stderr @@ -1,11 +1,11 @@ NamedExtraConstraintsWildcard.hs:5:1: error:
- • Could not deduce: t0
- from the context: (Eq a, t)
+ • Could not deduce: w0
+ from the context: (Eq a, w)
bound by the inferred type for ‘foo’:
- (Eq a, t) => a -> a
+ (Eq a, w) => 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 (t :: Constraint) a. (Eq a, t) => a -> a
+ foo :: forall (w :: Constraint) a. (Eq a, w) => a -> a
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr index 83a9019401..d401382141 100644 --- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr +++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardExplicitForall.stderr @@ -1,52 +1,41 @@ - -NamedWildcardExplicitForall.hs:8:7: error: - • Couldn't match type ‘_a’ with ‘Bool’ - ‘_a’ is a rigid type variable bound by - the type signature for: - foo :: forall _a. _a -> _a - at NamedWildcardExplicitForall.hs:7:15 - Expected type: _a -> _a - Actual type: Bool -> Bool - • In the expression: not - In an equation for ‘foo’: foo = not - • Relevant bindings include - foo :: _a -> _a (bound at NamedWildcardExplicitForall.hs:8:1) - -NamedWildcardExplicitForall.hs:10:8: error: - • Found type wildcard ‘_a’ standing for ‘Bool’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - bar :: _a -> _a - • Relevant bindings include - bar :: Bool -> Bool (bound at NamedWildcardExplicitForall.hs:11:1) - -NamedWildcardExplicitForall.hs:13:26: error: - • Found type wildcard ‘_b’ standing for ‘Bool’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - baz :: forall _a. _a -> _b -> (_a, _b) - • Relevant bindings include - baz :: _a -> Bool -> (_a, Bool) - (bound at NamedWildcardExplicitForall.hs:14:1) - -NamedWildcardExplicitForall.hs:14:16: error: - • Couldn't match expected type ‘Bool’ with actual type ‘_a’ - ‘_a’ is a rigid type variable bound by - the inferred type of baz :: _a -> Bool -> (_a, Bool) - at NamedWildcardExplicitForall.hs:13:15 - • In the first argument of ‘not’, namely ‘x’ - In the expression: not x - In the expression: (not x, not y) - • Relevant bindings include - x :: _a (bound at NamedWildcardExplicitForall.hs:14:5) - baz :: _a -> Bool -> (_a, Bool) - (bound at NamedWildcardExplicitForall.hs:14:1) - -NamedWildcardExplicitForall.hs:16:8: error: - • Found type wildcard ‘_a’ standing for ‘Bool’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - qux :: _a -> (forall _a. _a -> _a) -> _a - • Relevant bindings include - qux :: Bool -> (forall _a. _a -> _a) -> Bool - (bound at NamedWildcardExplicitForall.hs:17:1) +
+NamedWildcardExplicitForall.hs:8:7: error:
+ • Couldn't match type ‘_a’ with ‘Bool’
+ ‘_a’ is a rigid type variable bound by
+ the type signature for:
+ foo :: forall _a. _a -> _a
+ at NamedWildcardExplicitForall.hs:7:1-27
+ Expected type: _a -> _a
+ Actual type: Bool -> Bool
+ • In the expression: not
+ In an equation for ‘foo’: foo = not
+ • Relevant bindings include
+ foo :: _a -> _a (bound at NamedWildcardExplicitForall.hs:8:1)
+
+NamedWildcardExplicitForall.hs:10:8: error:
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _a -> _a
+
+NamedWildcardExplicitForall.hs:13:26: error:
+ • Found type wildcard ‘_b’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: baz :: forall _a. _a -> _b -> (_a, _b)
+
+NamedWildcardExplicitForall.hs:14:16: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘_a’
+ ‘_a’ is a rigid type variable bound by
+ the inferred type of baz :: _a -> Bool -> (_a, Bool)
+ at NamedWildcardExplicitForall.hs:14:1-24
+ • In the first argument of ‘not’, namely ‘x’
+ In the expression: not x
+ In the expression: (not x, not y)
+ • Relevant bindings include
+ x :: _a (bound at NamedWildcardExplicitForall.hs:14:5)
+ baz :: _a -> Bool -> (_a, Bool)
+ (bound at NamedWildcardExplicitForall.hs:14:1)
+
+NamedWildcardExplicitForall.hs:16:8: error:
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: qux :: _a -> (forall _a. _a -> _a) -> _a
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr index 805854a1f2..34bf595a7f 100644 --- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr +++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsEnabled.stderr @@ -1,16 +1,10 @@ - -NamedWildcardsEnabled.hs:4:8: error: - • Found type wildcard ‘_a’ standing for ‘Bool’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - foo :: _a -> _b - • Relevant bindings include - foo :: Bool -> Bool (bound at NamedWildcardsEnabled.hs:5:1) - -NamedWildcardsEnabled.hs:4:14: error: - • Found type wildcard ‘_b’ standing for ‘Bool’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - foo :: _a -> _b - • Relevant bindings include - foo :: Bool -> Bool (bound at NamedWildcardsEnabled.hs:5:1) +
+NamedWildcardsEnabled.hs:4:8: error:
+ • Found type wildcard ‘_a’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _a -> _b
+
+NamedWildcardsEnabled.hs:4:14: error:
+ • Found type wildcard ‘_b’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _a -> _b
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr index 46cad28a12..baaaf010d7 100644 --- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr +++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotEnabled.stderr @@ -1,24 +1,24 @@ - -NamedWildcardsNotEnabled.hs:4:9: error: - • Couldn't match expected type ‘_b’ with actual type ‘Bool’ - ‘_b’ is a rigid type variable bound by - the type signature for: - foo :: forall _a _b. _a -> _b - at NamedWildcardsNotEnabled.hs:3:8 - • In the expression: not x - In an equation for ‘foo’: foo x = not x - • Relevant bindings include - foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1) - -NamedWildcardsNotEnabled.hs:4:13: error: - • Couldn't match expected type ‘Bool’ with actual type ‘_a’ - ‘_a’ is a rigid type variable bound by - the type signature for: - foo :: forall _a _b. _a -> _b - at NamedWildcardsNotEnabled.hs:3:8 - • In the first argument of ‘not’, namely ‘x’ - In the expression: not x - In an equation for ‘foo’: foo x = not x - • Relevant bindings include - x :: _a (bound at NamedWildcardsNotEnabled.hs:4:5) - foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1) +
+NamedWildcardsNotEnabled.hs:4:9: error:
+ • Couldn't match expected type ‘_b’ with actual type ‘Bool’
+ ‘_b’ is a rigid type variable bound by
+ the type signature for:
+ foo :: forall _a _b. _a -> _b
+ at NamedWildcardsNotEnabled.hs:3:1-15
+ • In the expression: not x
+ In an equation for ‘foo’: foo x = not x
+ • Relevant bindings include
+ foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1)
+
+NamedWildcardsNotEnabled.hs:4:13: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘_a’
+ ‘_a’ is a rigid type variable bound by
+ the type signature for:
+ foo :: forall _a _b. _a -> _b
+ at NamedWildcardsNotEnabled.hs:3:1-15
+ • In the first argument of ‘not’, namely ‘x’
+ In the expression: not x
+ In an equation for ‘foo’: foo x = not x
+ • Relevant bindings include
+ x :: _a (bound at NamedWildcardsNotEnabled.hs:4:5)
+ foo :: _a -> _b (bound at NamedWildcardsNotEnabled.hs:4:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr index 244b470e81..20176895eb 100644 --- a/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr +++ b/testsuite/tests/partial-sigs/should_fail/NamedWildcardsNotInMonotype.stderr @@ -1,12 +1,12 @@ - -NamedWildcardsNotInMonotype.hs:5:1: error: - • Could not deduce (Eq t0) - from the context: (Show a, Eq t, Eq a) - bound by the inferred type for ‘foo’: - (Show a, Eq t, Eq a) => a -> a -> String - at NamedWildcardsNotInMonotype.hs:5:1-33 - The type variable ‘t0’ is ambiguous - • 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 t a. (Show a, Eq t, Eq a) => a -> a -> String +
+NamedWildcardsNotInMonotype.hs:5:1: error:
+ • Could not deduce (Eq w0)
+ from the context: (Show a, Eq w, Eq a)
+ bound by the inferred type for ‘foo’:
+ (Show a, Eq w, Eq a) => a -> a -> String
+ at NamedWildcardsNotInMonotype.hs:5:1-33
+ The type variable ‘w0’ is ambiguous
+ • 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 w a. (Show a, Eq w, Eq a) => a -> a -> String
diff --git a/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr b/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr index 025379a67d..91a8dbe7fd 100644 --- a/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr +++ b/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr @@ -1,16 +1,10 @@ - -PartialTypeSignaturesDisabled.hs:4:8: error: - • Found type wildcard ‘_’ standing for ‘Bool’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - foo :: _ -> _ - • Relevant bindings include - foo :: Bool -> Bool (bound at PartialTypeSignaturesDisabled.hs:5:1) - -PartialTypeSignaturesDisabled.hs:4:13: error: - • Found type wildcard ‘_’ standing for ‘Bool’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - foo :: _ -> _ - • Relevant bindings include - foo :: Bool -> Bool (bound at PartialTypeSignaturesDisabled.hs:5:1) +
+PartialTypeSignaturesDisabled.hs:4:8: error:
+ • Found type wildcard ‘_’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _ -> _
+
+PartialTypeSignaturesDisabled.hs:4:13: error:
+ • Found type wildcard ‘_’ standing for ‘Bool’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: _ -> _
diff --git a/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr b/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr index 436777b2d8..c04cfa2315 100644 --- a/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr +++ b/testsuite/tests/partial-sigs/should_fail/PatBind3.stderr @@ -1,9 +1,9 @@ PatBind3.hs:6:12: error:
- • Couldn't match type ‘(Bool, t)’ with ‘Char’
- Expected type: Maybe ((Bool, t) -> Char)
- Actual type: Maybe ((Bool, t) -> (Bool, t))
+ • Couldn't match type ‘(Bool, w)’ with ‘Char’
+ Expected type: Maybe ((Bool, w) -> Char)
+ Actual type: Maybe ((Bool, w) -> (Bool, w))
• In the expression: Just id
In a pattern binding: Just foo = Just id
• Relevant bindings include
- foo :: (Bool, t) -> Char (bound at PatBind3.hs:6:6)
+ foo :: (Bool, w) -> Char (bound at PatBind3.hs:6:6)
diff --git a/testsuite/tests/partial-sigs/should_fail/T10045.stderr b/testsuite/tests/partial-sigs/should_fail/T10045.stderr index d6a3a5ac37..74bfaae357 100644 --- a/testsuite/tests/partial-sigs/should_fail/T10045.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T10045.stderr @@ -1,25 +1,23 @@ - -T10045.hs:6:18: error: - • Found type wildcard ‘_’ standing for ‘t2 -> Bool -> t1’ - Where: ‘t1’ is a rigid type variable bound by - the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10 - ‘t2’ is a rigid type variable bound by - the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10 - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - copy :: _ - In the expression: - let - copy :: _ - copy w from = copy w True - in copy ws1 False - In an equation for ‘foo’: - foo (Meta ws1) - = let - copy :: _ - copy w from = copy w True - in copy ws1 False - • Relevant bindings include - copy :: t2 -> Bool -> t1 (bound at T10045.hs:7:10) - ws1 :: () (bound at T10045.hs:5:11) - foo :: Meta -> t (bound at T10045.hs:5:1) +
+T10045.hs:6:18: error:
+ • Found type wildcard ‘_’ standing for ‘t2 -> Bool -> t1’
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10-34
+ ‘t2’ is a rigid type variable bound by
+ the inferred type of copy :: t2 -> Bool -> t1 at T10045.hs:7:10-34
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: copy :: _
+ In the expression:
+ let
+ copy :: _
+ copy w from = copy w True
+ in copy ws1 False
+ In an equation for ‘foo’:
+ foo (Meta ws1)
+ = let
+ copy :: _
+ copy w from = copy w True
+ in copy ws1 False
+ • Relevant bindings include
+ ws1 :: () (bound at T10045.hs:5:11)
+ foo :: Meta -> t (bound at T10045.hs:5:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/T10615.stderr b/testsuite/tests/partial-sigs/should_fail/T10615.stderr index 842b2eb10a..9e46dd20d1 100644 --- a/testsuite/tests/partial-sigs/should_fail/T10615.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T10615.stderr @@ -1,36 +1,32 @@ - -T10615.hs:4:7: error: - • Found type wildcard ‘_’ standing for ‘a1’ - Where: ‘a1’ is an ambiguous type variable - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - f1 :: _ -> f - • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1) - -T10615.hs:5:6: error: - • Couldn't match type ‘f’ with ‘b1 -> a1’ - ‘f’ is a rigid type variable bound by - the inferred type of f1 :: a1 -> f at T10615.hs:4:7 - Expected type: a1 -> f - Actual type: a1 -> b1 -> a1 - • In the expression: const - In an equation for ‘f1’: f1 = const - • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1) - -T10615.hs:7:7: error: - • Found type wildcard ‘_’ standing for ‘a0’ - Where: ‘a0’ is an ambiguous type variable - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - f2 :: _ -> _f - • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1) - -T10615.hs:8:6: error: - • Couldn't match type ‘_f’ with ‘b0 -> a0’ - ‘_f’ is a rigid type variable bound by - the inferred type of f2 :: a0 -> _f at T10615.hs:7:7 - Expected type: a0 -> _f - Actual type: a0 -> b0 -> a0 - • In the expression: const - In an equation for ‘f2’: f2 = const - • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1) +
+T10615.hs:4:7: error:
+ • Found type wildcard ‘_’ standing for ‘a1’
+ Where: ‘a1’ is an ambiguous type variable
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f1 :: _ -> f
+
+T10615.hs:5:6: error:
+ • Couldn't match type ‘f’ with ‘b1 -> a1’
+ ‘f’ is a rigid type variable bound by
+ the inferred type of f1 :: a1 -> f at T10615.hs:5:1-10
+ Expected type: a1 -> f
+ Actual type: a1 -> b1 -> a1
+ • In the expression: const
+ In an equation for ‘f1’: f1 = const
+ • Relevant bindings include f1 :: a1 -> f (bound at T10615.hs:5:1)
+
+T10615.hs:7:7: error:
+ • Found type wildcard ‘_’ standing for ‘a0’
+ Where: ‘a0’ is an ambiguous type variable
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f2 :: _ -> _f
+
+T10615.hs:8:6: error:
+ • Couldn't match type ‘_f’ with ‘b0 -> a0’
+ ‘_f’ is a rigid type variable bound by
+ the inferred type of f2 :: a0 -> _f at T10615.hs:8:1-10
+ Expected type: a0 -> _f
+ Actual type: a0 -> b0 -> a0
+ • In the expression: const
+ In an equation for ‘f2’: f2 = const
+ • Relevant bindings include f2 :: a0 -> _f (bound at T10615.hs:8:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/T10999.stderr b/testsuite/tests/partial-sigs/should_fail/T10999.stderr index c74719addf..fff2bdeae9 100644 --- a/testsuite/tests/partial-sigs/should_fail/T10999.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T10999.stderr @@ -1,16 +1,34 @@ - -T10999.hs:5:6: error: - Found constraint wildcard ‘_’ standing for ‘Ord a’ - To use the inferred type, enable PartialTypeSignatures - In the type signature: - f :: _ => () -> _ - -T10999.hs:5:17: error: - • Found type wildcard ‘_’ standing for ‘Set.Set a’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of f :: Ord a => () -> Set.Set a at T10999.hs:6:1 - To use the inferred type, enable PartialTypeSignatures - • In the type signature: - f :: _ => () -> _ - • Relevant bindings include - f :: () -> Set.Set a (bound at T10999.hs:6:1) +
+T10999.hs:5:6: error:
+ • Found type wildcard ‘_’ standing for ‘Ord a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of f :: Ord a => () -> Set.Set a
+ at T10999.hs:6:1-28
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f :: _ => () -> _
+
+T10999.hs:5:17: error:
+ • Found type wildcard ‘_’ standing for ‘Set.Set a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of f :: Ord a => () -> Set.Set a
+ at T10999.hs:6:1-28
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: f :: _ => () -> _
+
+T10999.hs:8:28: error:
+ • Ambiguous type variable ‘b0’ arising from a use of ‘f’
+ prevents the constraint ‘(Ord b0)’ from being solved.
+ Relevant bindings include g :: [b0] (bound at T10999.hs:8:1)
+ Probable fix: use a type annotation to specify what ‘b0’ should be.
+ These potential instances exist:
+ instance Ord a => Ord (Set.Set a)
+ -- Defined in ‘containers-0.5.7.1:Data.Set.Base’
+ instance Ord Ordering -- Defined in ‘GHC.Classes’
+ instance Ord Integer
+ -- Defined in ‘integer-gmp-1.0.0.1:GHC.Integer.Type’
+ ...plus 23 others
+ ...plus two instances involving out-of-scope types
+ (use -fprint-potential-instances to see them all)
+ • In the second argument of ‘($)’, namely ‘f ()’
+ In the second argument of ‘($)’, namely ‘Set.toList $ f ()’
+ In the expression: map fst $ Set.toList $ f ()
diff --git a/testsuite/tests/partial-sigs/should_fail/T11122.stderr b/testsuite/tests/partial-sigs/should_fail/T11122.stderr index 4a8b75be4a..9216985a58 100644 --- a/testsuite/tests/partial-sigs/should_fail/T11122.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T11122.stderr @@ -1,7 +1,4 @@ - -T11122.hs:19:18: warning: [-Wpartial-type-signatures (in -Wdefault)] - • Found type wildcard ‘_’ standing for ‘Int’ - • In the type signature: - parser :: Parser _ - • Relevant bindings include - parser :: Parser Int (bound at T11122.hs:21:1) +
+T11122.hs:19:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
+ • Found type wildcard ‘_’ standing for ‘Int’
+ • In the type signature: parser :: Parser _
diff --git a/testsuite/tests/partial-sigs/should_fail/T11976.stderr b/testsuite/tests/partial-sigs/should_fail/T11976.stderr index 06320d9aa9..ac7319891e 100644 --- a/testsuite/tests/partial-sigs/should_fail/T11976.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T11976.stderr @@ -1,7 +1,7 @@ - -T11976.hs:7:20: error: - • Expecting one fewer arguments to ‘Lens t0 t1’ - Expected kind ‘k0 -> *’, but ‘Lens t0 t1’ has kind ‘*’ - • In the type ‘Lens _ _ _’ - In the expression: undefined :: Lens _ _ _ - In an equation for ‘foo’: foo = undefined :: Lens _ _ _ +
+T11976.hs:7:20: error:
+ • Expecting one fewer arguments to ‘Lens w0 w1’
+ Expected kind ‘k0 -> *’, but ‘Lens w0 w1’ has kind ‘*’
+ • In the type ‘Lens _ _ _’
+ In an expression type signature: Lens _ _ _
+ In the expression: undefined :: Lens _ _ _
diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr index 884a4c0bf4..596abe1160 100644 --- a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr +++ b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr @@ -1,18 +1,16 @@ TidyClash.hs:8:19: error:
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of bar :: w_ -> (w_, t1 -> t) at TidyClash.hs:9:1
+ • Found type wildcard ‘_’ standing for ‘w1’
+ Where: ‘w1’ is a rigid type variable bound by
+ the inferred type of bar :: w_ -> (w_, w1 -> w)
+ at TidyClash.hs:9:1-28
To use the inferred type, enable PartialTypeSignatures
• In the type signature: bar :: w_ -> (w_, _ -> _)
- • Relevant bindings include
- bar :: w_ -> (w_, t1 -> t) (bound at TidyClash.hs:9:1)
TidyClash.hs:8:24: error:
- • Found type wildcard ‘_’ standing for ‘t’
- Where: ‘t’ is a rigid type variable bound by
- the inferred type of bar :: w_ -> (w_, t1 -> t) at TidyClash.hs:9:1
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: w_ -> (w_, w1 -> w)
+ at TidyClash.hs:9:1-28
To use the inferred type, enable PartialTypeSignatures
• In the type signature: bar :: w_ -> (w_, _ -> _)
- • Relevant bindings include
- bar :: w_ -> (w_, t1 -> t) (bound at TidyClash.hs:9:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr index f59ab4d6c9..00c3874a4b 100644 --- a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr +++ b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr @@ -1,57 +1,53 @@ TidyClash2.hs:13:20: error:
- • Found type wildcard ‘_’ standing for ‘t2’
- Where: ‘t2’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w1’
+ Where: ‘w1’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In the type signature: barry :: forall t. _ -> _ -> t
- • Relevant bindings include
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:13:25: error:
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In the type signature: barry :: forall t. _ -> _ -> t
- • Relevant bindings include
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:14:13: error:
- • Found type wildcard ‘_’ standing for ‘t2’
- Where: ‘t2’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w1’
+ Where: ‘w1’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In a pattern type signature: _
In the pattern: x :: _
In an equation for ‘barry’:
barry (x :: _) (y :: _) = undefined :: _
• Relevant bindings include
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
+ barry :: w1 -> w -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:14:22: error:
- • Found type wildcard ‘_’ standing for ‘t1’
- Where: ‘t1’ is a rigid type variable bound by
- the inferred type of barry :: t2 -> t1 -> t at TidyClash2.hs:14:1
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of barry :: w1 -> w -> t at TidyClash2.hs:14:1-40
To use the inferred type, enable PartialTypeSignatures
• In a pattern type signature: _
In the pattern: y :: _
In an equation for ‘barry’:
barry (x :: _) (y :: _) = undefined :: _
• Relevant bindings include
- x :: t2 (bound at TidyClash2.hs:14:8)
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
+ x :: w1 (bound at TidyClash2.hs:14:8)
+ barry :: w1 -> w -> t (bound at TidyClash2.hs:14:1)
TidyClash2.hs:14:40: error:
- • Found type wildcard ‘_’ standing for ‘t3’
- Where: ‘t3’ is a rigid type variable bound by
- the inferred type of <expression> :: t3 at TidyClash2.hs:14:27
+ • Found type wildcard ‘_’ standing for ‘w2’
+ Where: ‘w2’ is a rigid type variable bound by
+ the inferred type of <expression> :: w2 at TidyClash2.hs:14:40
To use the inferred type, enable PartialTypeSignatures
• In an expression type signature: _
In the expression: undefined :: _
In an equation for ‘barry’:
barry (x :: _) (y :: _) = undefined :: _
• Relevant bindings include
- y :: t1 (bound at TidyClash2.hs:14:17)
- x :: t2 (bound at TidyClash2.hs:14:8)
- barry :: t2 -> t1 -> t (bound at TidyClash2.hs:14:1)
+ y :: w (bound at TidyClash2.hs:14:17)
+ x :: w1 (bound at TidyClash2.hs:14:8)
+ barry :: w1 -> w -> t (bound at TidyClash2.hs:14:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr index e134fbbcd3..d026cbc70d 100644 --- a/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr +++ b/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr @@ -1,58 +1,48 @@ - -WildcardInstantiations.hs:5:14: error: - • Found type wildcard ‘_a’ standing for ‘a’ - Where: ‘a’ is a rigid type variable bound by - the inferred type of foo :: (Show a, Enum a) => a -> String - at WildcardInstantiations.hs:6:1 - To use the inferred type, enable PartialTypeSignatures - • In the type signature: foo :: (Show _a, _) => _a -> _ - • Relevant bindings include - foo :: a -> String (bound at WildcardInstantiations.hs:6:1) - -WildcardInstantiations.hs:5:18: error: - Found constraint wildcard ‘_’ standing for ‘Enum a’ - To use the inferred type, enable PartialTypeSignatures - In the type signature: foo :: (Show _a, _) => _a -> _ - -WildcardInstantiations.hs:5:30: error: - • Found type wildcard ‘_’ standing for ‘String’ - To use the inferred type, enable PartialTypeSignatures - • In the type signature: foo :: (Show _a, _) => _a -> _ - • Relevant bindings include - foo :: a -> String (bound at WildcardInstantiations.hs:6:1) - -WildcardInstantiations.hs:8:8: error: - • Found type wildcard ‘_’ standing for ‘t1’ - Where: ‘t1’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WildcardInstantiations.hs:9:1 - To use the inferred type, enable PartialTypeSignatures - • In the type signature: bar :: _ -> _ -> _ - • Relevant bindings include - bar :: t1 -> (t1 -> t) -> t - (bound at WildcardInstantiations.hs:9:1) - -WildcardInstantiations.hs:8:13: error: - • Found type wildcard ‘_’ standing for ‘t1 -> t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WildcardInstantiations.hs:9:1 - ‘t1’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WildcardInstantiations.hs:9:1 - To use the inferred type, enable PartialTypeSignatures - • In the type signature: bar :: _ -> _ -> _ - • Relevant bindings include - bar :: t1 -> (t1 -> t) -> t - (bound at WildcardInstantiations.hs:9:1) - -WildcardInstantiations.hs:8:18: error: - • Found type wildcard ‘_’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: t1 -> (t1 -> t) -> t - at WildcardInstantiations.hs:9:1 - To use the inferred type, enable PartialTypeSignatures - • In the type signature: bar :: _ -> _ -> _ - • Relevant bindings include - bar :: t1 -> (t1 -> t) -> t - (bound at WildcardInstantiations.hs:9:1) +
+WildcardInstantiations.hs:5:14: error:
+ • Found type wildcard ‘_a’ standing for ‘a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WildcardInstantiations.hs:6:1-21
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WildcardInstantiations.hs:5:18: error:
+ • Found type wildcard ‘_’ standing for ‘Enum a’
+ Where: ‘a’ is a rigid type variable bound by
+ the inferred type of foo :: (Show a, Enum a) => a -> String
+ at WildcardInstantiations.hs:6:1-21
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WildcardInstantiations.hs:5:30: error:
+ • Found type wildcard ‘_’ standing for ‘String’
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: foo :: (Show _a, _) => _a -> _
+
+WildcardInstantiations.hs:8:8: error:
+ • Found type wildcard ‘_’ standing for ‘t’
+ Where: ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _ -> _ -> _
+
+WildcardInstantiations.hs:8:13: error:
+ • Found type wildcard ‘_’ standing for ‘t -> w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ ‘t’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _ -> _ -> _
+
+WildcardInstantiations.hs:8:18: error:
+ • Found type wildcard ‘_’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: t -> (t -> w) -> w
+ at WildcardInstantiations.hs:9:1-13
+ To use the inferred type, enable PartialTypeSignatures
+ • In the type signature: bar :: _ -> _ -> _
diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr index db14490466..44879c9d4f 100644 --- a/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr +++ b/testsuite/tests/partial-sigs/should_fail/WildcardsInPatternAndExprSig.stderr @@ -1,74 +1,74 @@ - -WildcardsInPatternAndExprSig.hs:4:18: error: - • Found type wildcard ‘_a’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: Maybe [t] -> t -> [t] - at WildcardsInPatternAndExprSig.hs:4:1 - To use the inferred type, enable PartialTypeSignatures - • In a pattern type signature: _a - In the pattern: x :: _a - In the pattern: [x :: _a] - • Relevant bindings include - bar :: Maybe [t] -> t -> [t] - (bound at WildcardsInPatternAndExprSig.hs:4:1) - -WildcardsInPatternAndExprSig.hs:4:25: error: - • Found type wildcard ‘_’ standing for ‘[t]’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: Maybe [t] -> t -> [t] - at WildcardsInPatternAndExprSig.hs:4:1 - To use the inferred type, enable PartialTypeSignatures - • In a pattern type signature: _ - In the pattern: [x :: _a] :: _ - In the pattern: Just ([x :: _a] :: _) - • Relevant bindings include - bar :: Maybe [t] -> t -> [t] - (bound at WildcardsInPatternAndExprSig.hs:4:1) - -WildcardsInPatternAndExprSig.hs:4:38: error: - • Found type wildcard ‘_b’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: Maybe [t] -> t -> [t] - at WildcardsInPatternAndExprSig.hs:4:1 - To use the inferred type, enable PartialTypeSignatures - • In a pattern type signature: Maybe [_b] - In the pattern: Just ([x :: _a] :: _) :: Maybe [_b] - In an equation for ‘bar’: - bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c) - = [x, z] :: [_d] - • Relevant bindings include - bar :: Maybe [t] -> t -> [t] - (bound at WildcardsInPatternAndExprSig.hs:4:1) - -WildcardsInPatternAndExprSig.hs:4:49: error: - • Found type wildcard ‘_c’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: Maybe [t] -> t -> [t] - at WildcardsInPatternAndExprSig.hs:4:1 - To use the inferred type, enable PartialTypeSignatures - • In a pattern type signature: _c - In the pattern: z :: _c - In an equation for ‘bar’: - bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c) - = [x, z] :: [_d] - • Relevant bindings include - x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13) - bar :: Maybe [t] -> t -> [t] - (bound at WildcardsInPatternAndExprSig.hs:4:1) - -WildcardsInPatternAndExprSig.hs:4:66: error: - • Found type wildcard ‘_d’ standing for ‘t’ - Where: ‘t’ is a rigid type variable bound by - the inferred type of bar :: Maybe [t] -> t -> [t] - at WildcardsInPatternAndExprSig.hs:4:1 - To use the inferred type, enable PartialTypeSignatures - • In an expression type signature: [_d] - In the expression: [x, z] :: [_d] - In an equation for ‘bar’: - bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c) - = [x, z] :: [_d] - • Relevant bindings include - z :: t (bound at WildcardsInPatternAndExprSig.hs:4:44) - x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13) - bar :: Maybe [t] -> t -> [t] - (bound at WildcardsInPatternAndExprSig.hs:4:1) +
+WildcardsInPatternAndExprSig.hs:4:18: error:
+ • Found type wildcard ‘_a’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _a
+ In the pattern: x :: _a
+ In the pattern: [x :: _a]
+ • Relevant bindings include
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:25: error:
+ • Found type wildcard ‘_’ standing for ‘[w]’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _
+ In the pattern: [x :: _a] :: _
+ In the pattern: Just ([x :: _a] :: _)
+ • Relevant bindings include
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:38: error:
+ • Found type wildcard ‘_b’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: Maybe [_b]
+ In the pattern: Just ([x :: _a] :: _) :: Maybe [_b]
+ In an equation for ‘bar’:
+ bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
+ = [x, z] :: [_d]
+ • Relevant bindings include
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:49: error:
+ • Found type wildcard ‘_c’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In a pattern type signature: _c
+ In the pattern: z :: _c
+ In an equation for ‘bar’:
+ bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
+ = [x, z] :: [_d]
+ • Relevant bindings include
+ x :: w (bound at WildcardsInPatternAndExprSig.hs:4:13)
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
+
+WildcardsInPatternAndExprSig.hs:4:66: error:
+ • Found type wildcard ‘_d’ standing for ‘w’
+ Where: ‘w’ is a rigid type variable bound by
+ the inferred type of bar :: Maybe [w] -> w -> [w]
+ at WildcardsInPatternAndExprSig.hs:4:1-68
+ To use the inferred type, enable PartialTypeSignatures
+ • In an expression type signature: [_d]
+ In the expression: [x, z] :: [_d]
+ In an equation for ‘bar’:
+ bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
+ = [x, z] :: [_d]
+ • Relevant bindings include
+ z :: w (bound at WildcardsInPatternAndExprSig.hs:4:44)
+ x :: w (bound at WildcardsInPatternAndExprSig.hs:4:13)
+ bar :: Maybe [w] -> w -> [w]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T index 67d59a5ced..e8f5928c45 100644 --- a/testsuite/tests/partial-sigs/should_fail/all.T +++ b/testsuite/tests/partial-sigs/should_fail/all.T @@ -1,7 +1,7 @@ test('AnnotatedConstraint', normal, compile_fail, ['']) test('AnnotatedConstraintNotForgotten', normal, compile_fail, ['']) test('Defaulting1MROff', normal, compile, ['']) -test('ExtraConstraintsWildcardInExpressionSignature', normal, compile_fail, ['']) +test('ExtraConstraintsWildcardInExpressionSignature', normal, compile, ['']) test('ExtraConstraintsWildcardInPatternSignature', normal, compile_fail, ['']) test('ExtraConstraintsWildcardInPatternSplice', normal, compile_fail, ['']) test('ExtraConstraintsWildcardInTypeSpliceUsed', @@ -62,3 +62,4 @@ test('T11122', normal, compile, ['']) test('T11976', normal, compile_fail, ['']) test('PatBind3', normal, compile_fail, ['']) test('T12039', normal, compile_fail, ['']) + |