Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,324
Issues
4,324
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
385
Merge Requests
385
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
9e86bf1b
Commit
9e86bf1b
authored
Jul 10, 2015
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better type wildcard errors
Adopts sugggestion in Trac #10224, comment:3
parent
0a3c43fe
Changes
12
Hide whitespace changes
Inline
Sidebyside
Showing
12 changed files
with
354 additions
and
350 deletions
+354
350
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcErrors.hs
+24
20
testsuite/tests/partialsigs/should_compile/T10403.stderr
testsuite/tests/partialsigs/should_compile/T10403.stderr
+36
36
testsuite/tests/partialsigs/should_compile/T10438.stderr
testsuite/tests/partialsigs/should_compile/T10438.stderr
+26
26
testsuite/tests/partialsigs/should_compile/WarningWildcardInstantiations.stderr
...sigs/should_compile/WarningWildcardInstantiations.stderr
+47
47
testsuite/tests/partialsigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr
...hould_fail/InstantiatedNamedWildcardsInConstraints.stderr
+13
13
testsuite/tests/partialsigs/should_fail/NamedWildcardsEnabled.stderr
...sts/partialsigs/should_fail/NamedWildcardsEnabled.stderr
+10
10
testsuite/tests/partialsigs/should_fail/PartialTypeSignaturesDisabled.stderr
...ialsigs/should_fail/PartialTypeSignaturesDisabled.stderr
+10
10
testsuite/tests/partialsigs/should_fail/TidyClash.stderr
testsuite/tests/partialsigs/should_fail/TidyClash.stderr
+16
16
testsuite/tests/partialsigs/should_fail/Trac10045.stderr
testsuite/tests/partialsigs/should_fail/Trac10045.stderr
+45
45
testsuite/tests/partialsigs/should_fail/WildcardInstantiations.stderr
...ts/partialsigs/should_fail/WildcardInstantiations.stderr
+45
45
testsuite/tests/partialsigs/should_fail/WildcardsInPatternAndExprSig.stderr
...tialsigs/should_fail/WildcardsInPatternAndExprSig.stderr
+74
74
testsuite/tests/typecheck/should_compile/T10072.stderr
testsuite/tests/typecheck/should_compile/T10072.stderr
+8
8
No files found.
compiler/typecheck/TcErrors.hs
View file @
9e86bf1b
...
...
@@ 697,9 +697,9 @@ mkHoleError ctxt ct@(CHoleCan { cc_occ = occ, cc_hole = hole_sort })

isOutOfScopeCt
ct
=
do
{
dflags
<
getDynFlags
;
rdr_env
<
getGlobalRdrEnv
;
mkLongErrAt
(
RealSrcSpan
(
tcl_loc
lcl_env
))
var
_msg
;
mkLongErrAt
(
RealSrcSpan
(
tcl_loc
lcl_env
))
out_of_scope
_msg
(
unknownNameSuggestions
dflags
rdr_env
(
tcl_rdr
lcl_env
)
(
mkRdrUnqual
occ
))
}
(
tcl_rdr
lcl_env
)
(
mkRdrUnqual
occ
))
}

otherwise
=
do
{
(
ctxt
,
binds_doc
,
ct
)
<
relevantBindings
False
ctxt
ct
...
...
@@ 707,37 +707,41 @@ mkHoleError ctxt ct@(CHoleCan { cc_occ = occ, cc_hole = hole_sort })
;
mkErrorMsgFromCt
ctxt
ct
(
hole_msg
$$
binds_doc
)
}
where
ct_loc
=
ctLoc
ct
lcl_env
=
ctLocEnv
ct_loc
var_msg
=
hang
herald
 Print v :: ty only if the type has structure
2
(
if
boring_type
then
ppr
occ
else
pp_with_type
)
ct_loc
=
ctLoc
ct
lcl_env
=
ctLocEnv
ct_loc
hole_ty
=
ctEvPred
(
ctEvidence
ct
)
tyvars
=
varSetElems
(
tyVarsOfType
hole_ty
)
boring_type
=
isTyVarTy
hole_ty
hole_msg
=
vcat
[
hang
(
ptext
(
sLit
"Found hole:"
))
2
pp_with_type
,
tyvars_msg
,
hint
]
out_of_scope_msg
 Print v :: ty only if the type has structure

boring_type
=
hang
herald
2
(
ppr
occ
)

otherwise
=
hang
herald
2
pp_with_type
pp_with_type
=
hang
(
pprPrefixOcc
occ
)
2
(
dcolon
<+>
pprType
hole_ty
)
herald

isDataOcc
occ
=
ptext
(
sLit
"Data constructor not in scope:"
)

otherwise
=
ptext
(
sLit
"Variable not in scope:"
)
hole_ty
=
ctEvPred
(
ctEvidence
ct
)
tyvars
=
varSetElems
(
tyVarsOfType
hole_ty
)
hole_msg
=
case
hole_sort
of
ExprHole
>
vcat
[
hang
(
ptext
(
sLit
"Found hole:"
))
2
pp_with_type
,
tyvars_msg
,
expr_hole_hint
]
TypeHole
>
vcat
[
hang
(
ptext
(
sLit
"Found type wildcard"
)
<+>
quotes
(
ppr
occ
))
2
(
ptext
(
sLit
"standing for"
)
<+>
quotes
(
pprType
hole_ty
))
,
tyvars_msg
,
type_hole_hint
]
tyvars_msg
=
ppUnless
(
null
tyvars
)
$
ptext
(
sLit
"Where:"
)
<+>
vcat
(
map
loc_msg
tyvars
)
boring_type
=
isTyVarTy
hole_ty
hint

TypeHole
<
hole_sor
t
,
HoleError
<
cec_type_holes
ctxt
type_hole_hin
t

HoleError
<
cec_type_holes
ctxt
=
ptext
(
sLit
"To use the inferred type, enable PartialTypeSignatures"
)

otherwise
=
empty

ExprHole
<
hole_sort
 Give hint for, say, f x = _x
,
lengthFS
(
occNameFS
occ
)
>
1
 Don't give this hint for plain "_"
expr_hole_hint
 Give hint for, say, f x = _x

lengthFS
(
occNameFS
occ
)
>
1
 Don't give this hint for plain "_"
=
ptext
(
sLit
"Or perhaps"
)
<+>
quotes
(
ppr
occ
)
<+>
ptext
(
sLit
"is misspelled, or not in scope"
)

otherwise
=
empty
...
...
testsuite/tests/partialsigs/should_compile/T10403.stderr
View file @
9e86bf1b
T10403.hs:15:7: warning:
Found hole ‘_’ with inferred constraints: Functor f
In the type signature for ‘h1’: _ => _
T10403.hs:15:12: warning:
Found
hole: _ :: (a > b) > f a > H f
Where: ‘f’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a > b) > f a > H f
at T10403.hs:17:1
‘b’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a > b) > f a > H f
at T10403.hs:17:1
‘a’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a > b) > f a > H f
at T10403.hs:17:1
In the type signature for ‘h1’: _ => _
T10403.hs:19:7: warning:
Found
hole: _ :: (a > b) > f a > H f
Where: ‘f’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a > b) > f a > H f
at T10403.hs:21:1
‘b’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a > b) > f a > H f
at T10403.hs:21:1
‘a’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a > b) > f a > H f
at T10403.hs:21:1
In the type signature for ‘h2’: _
T10403.hs:21:1: warning:
No instance for (Functor f)
When checking that ‘h2’ has the inferred type
h2 :: forall (f :: * > *) b a. (a > b) > f a > H f
Probable cause: the inferred type is ambiguous
T10403.hs:15:7: warning:
Found hole ‘_’ with inferred constraints: Functor f
In the type signature for ‘h1’: _ => _
T10403.hs:15:12: warning:
Found
type wildcard ‘_’ standing for ‘(a > b) > f a > H f’
Where: ‘f’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a > b) > f a > H f
at T10403.hs:17:1
‘b’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a > b) > f a > H f
at T10403.hs:17:1
‘a’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a > b) > f a > H f
at T10403.hs:17:1
In the type signature for ‘h1’: _ => _
T10403.hs:19:7: warning:
Found
type wildcard ‘_’ standing for ‘(a > b) > f a > H f’
Where: ‘f’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a > b) > f a > H f
at T10403.hs:21:1
‘b’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a > b) > f a > H f
at T10403.hs:21:1
‘a’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a > b) > f a > H f
at T10403.hs:21:1
In the type signature for ‘h2’: _
T10403.hs:21:1: warning:
No instance for (Functor f)
When checking that ‘h2’ has the inferred type
h2 :: forall (f :: * > *) b a. (a > b) > f a > H f
Probable cause: the inferred type is ambiguous
testsuite/tests/partialsigs/should_compile/T10438.stderr
View file @
9e86bf1b
T10438.hs:7:22: warning:
Found
hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of g :: w_1 > w_1 at T10438.hs:6:9
Relevant bindings include
r :: w_1 (bound at T10438.hs:6:11)
g :: w_1 > w_1 (bound at T10438.hs:6:9)
f :: t (bound at T10438.hs:5:5)
foo :: t > w_ > w_ (bound at T10438.hs:5:1)
In the type signature for ‘x’: _
In an equation for ‘g’:
g r
= x
where
x :: _
x = r
In an equation for ‘foo’:
foo f
= g
where
g r
= x
where
x :: _
x = r
T10438.hs:7:22: warning:
Found
type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of g :: w_1 > w_1 at T10438.hs:6:9
Relevant bindings include
r :: w_1 (bound at T10438.hs:6:11)
g :: w_1 > w_1 (bound at T10438.hs:6:9)
f :: t (bound at T10438.hs:5:5)
foo :: t > w_ > w_ (bound at T10438.hs:5:1)
In the type signature for ‘x’: _
In an equation for ‘g’:
g r
= x
where
x :: _
x = r
In an equation for ‘foo’:
foo f
= g
where
g r
= x
where
x :: _
x = r
testsuite/tests/partialsigs/should_compile/WarningWildcardInstantiations.stderr
View file @
9e86bf1b
TYPE SIGNATURES
bar :: forall w_ w_1. w_ > (w_ > w_1) > w_1
foo :: forall w_a. (Show w_a, Enum w_a) => w_a > String
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base4.8.2.0, ghcprim0.4.0.0,
integergmp1.0.0.0]
WarningWildcardInstantiations.hs:5:14: warning:
Found
hole: _a :: w_a
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a > String
at WarningWildcardInstantiations.hs:6:1
In the type signature for ‘foo’: (Show _a, _) => _a > _
WarningWildcardInstantiations.hs:5:18: warning:
Found hole ‘_’ with inferred constraints: Enum w_a
In the type signature for ‘foo’: (Show _a, _) => _a > _
WarningWildcardInstantiations.hs:5:30: warning:
Found
hole: _ :: String
In the type signature for ‘foo’: (Show _a, _) => _a > _
WarningWildcardInstantiations.hs:8:8: warning:
Found
hole: _ :: w_
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ > _ > _
WarningWildcardInstantiations.hs:8:13: warning:
Found
hole: _ :: w_ > w_1
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ > _ > _
WarningWildcardInstantiations.hs:8:18: warning:
Found
hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ > _ > _
TYPE SIGNATURES
bar :: forall w_ w_1. w_ > (w_ > w_1) > w_1
foo :: forall w_a. (Show w_a, Enum w_a) => w_a > String
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base4.8.2.0, ghcprim0.4.0.0,
integergmp1.0.0.0]
WarningWildcardInstantiations.hs:5:14: warning:
Found
type wildcard ‘_a’ standing for ‘w_a’
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a > String
at WarningWildcardInstantiations.hs:6:1
In the type signature for ‘foo’: (Show _a, _) => _a > _
WarningWildcardInstantiations.hs:5:18: warning:
Found hole ‘_’ with inferred constraints: Enum w_a
In the type signature for ‘foo’: (Show _a, _) => _a > _
WarningWildcardInstantiations.hs:5:30: warning:
Found
type wildcard ‘_’ standing for ‘String’
In the type signature for ‘foo’: (Show _a, _) => _a > _
WarningWildcardInstantiations.hs:8:8: warning:
Found
type wildcard ‘_’ standing for ‘w_’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ > _ > _
WarningWildcardInstantiations.hs:8:13: warning:
Found
type wildcard ‘_’ standing for ‘w_ > w_1’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ > _ > _
WarningWildcardInstantiations.hs:8:18: warning:
Found
type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ > _ > _
testsuite/tests/partialsigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr
View file @
9e86bf1b
InstantiatedNamedWildcardsInConstraints.hs:4:14: error:
Found
hole: _a :: 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 for ‘foo’: (Enum _a, _) => _a > (String, b)
InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
Found hole ‘_’ with inferred constraints: Show b
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘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:4:8
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Enum _a, _) => _a > (String, b)
InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
Found hole ‘_’ with inferred constraints: Show b
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Enum _a, _) => _a > (String, b)
testsuite/tests/partialsigs/should_fail/NamedWildcardsEnabled.stderr
View file @
9e86bf1b
NamedWildcardsEnabled.hs:4:8: error:
Found
hole: _a :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _a > _b
NamedWildcardsEnabled.hs:4:14: error:
Found
hole: _b :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _a > _b
NamedWildcardsEnabled.hs:4:8: error:
Found
type wildcard ‘_a’ standing for ‘Bool’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘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 for ‘foo’: _a > _b
testsuite/tests/partialsigs/should_fail/PartialTypeSignaturesDisabled.stderr
View file @
9e86bf1b
PartialTypeSignaturesDisabled.hs:4:8: error:
Found
hole: _ :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ > _
PartialTypeSignaturesDisabled.hs:4:13: error:
Found
hole: _ :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ > _
PartialTypeSignaturesDisabled.hs:4:8: error:
Found
type wildcard ‘_’ standing for ‘Bool’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ > _
PartialTypeSignaturesDisabled.hs:4:13: error:
Found
type wildcard ‘_’ standing for ‘Bool’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ > _
testsuite/tests/partialsigs/should_fail/TidyClash.stderr
View file @
9e86bf1b
TidyClash.hs:8:19: error:
Found
hole: _ :: w_
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_2 > (w_2, w_ > w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ > (w_, _ > _)
TidyClash.hs:8:24: error:
Found
hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_2 > (w_2, w_ > w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ > (w_, _ > _)
TidyClash.hs:8:19: error:
Found
type wildcard ‘_’ standing for ‘w_’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_2 > (w_2, w_ > w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ > (w_, _ > _)
TidyClash.hs:8:24: error:
Found
type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_2 > (w_2, w_ > w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ > (w_, _ > _)
testsuite/tests/partialsigs/should_fail/Trac10045.stderr
View file @
9e86bf1b
Trac10045.hs:6:17: error:
Found
hole: _ :: t1 > a > t2
Where: ‘t1’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 > a > t2
at Trac10045.hs:7:9
‘t2’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 > a > t2
at Trac10045.hs:7:9
‘a’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 > a > t2
at Trac10045.hs:7:9
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
ws1 :: () (bound at Trac10045.hs:5:11)
foo :: Meta > t (bound at Trac10045.hs:5:1)
In the type signature for ‘copy’: _
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
Trac10045.hs:7:9: error:
No instance for (Num a)
When checking that ‘copy’ has the inferred type
copy :: forall t t1 a. t > a > t1
Probable cause: the inferred type is ambiguous
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
Trac10045.hs:6:17: error:
Found
type wildcard ‘_’ standing for ‘t1 > a > t2’
Where: ‘t1’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 > a > t2
at Trac10045.hs:7:9
‘t2’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 > a > t2
at Trac10045.hs:7:9
‘a’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 > a > t2
at Trac10045.hs:7:9
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
ws1 :: () (bound at Trac10045.hs:5:11)
foo :: Meta > t (bound at Trac10045.hs:5:1)
In the type signature for ‘copy’: _
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
Trac10045.hs:7:9: error:
No instance for (Num a)
When checking that ‘copy’ has the inferred type
copy :: forall t t1 a. t > a > t1
Probable cause: the inferred type is ambiguous
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
testsuite/tests/partialsigs/should_fail/WildcardInstantiations.stderr
View file @
9e86bf1b
WildcardInstantiations.hs:5:14: error:
Found
hole: _a :: w_a
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a > String
at WildcardInstantiations.hs:6:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a > _
WildcardInstantiations.hs:5:18: error:
Found hole ‘_’ with inferred constraints: Enum w_a
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a > _
WildcardInstantiations.hs:5:30: error:
Found
hole: _ :: String
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a > _
WildcardInstantiations.hs:8:8: error:
Found
hole: _ :: w_
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ > _ > _
WildcardInstantiations.hs:8:13: error:
Found
hole: _ :: w_ > w_1
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ > _ > _
WildcardInstantiations.hs:8:18: error:
Found
hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ > _ > _
WildcardInstantiations.hs:5:14: error:
Found
type wildcard ‘_a’ standing for ‘w_a’
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a > String
at WildcardInstantiations.hs:6:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a > _
WildcardInstantiations.hs:5:18: error:
Found hole ‘_’ with inferred constraints: Enum w_a
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘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 for ‘foo’: (Show _a, _) => _a > _
WildcardInstantiations.hs:8:8: error:
Found
type wildcard ‘_’ standing for ‘w_’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ > _ > _
WildcardInstantiations.hs:8:13: error:
Found
type wildcard ‘_’ standing for ‘w_ > w_1’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ > _ > _
WildcardInstantiations.hs:8:18: error:
Found
type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ > (w_ > w_1) > w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ > _ > _
testsuite/tests/partialsigs/should_fail/WildcardsInPatternAndExprSig.stderr
View file @
9e86bf1b
WildcardsInPatternAndExprSig.hs:4:18: error:
Found
hole: _a :: w_c
Where: ‘w_c’ is a rigid type variable bound by
the inferred type of bar :: Maybe [w_c] > w_c > [w_c]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
bar :: Maybe [w_c] > w_c > [w_c]
(bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: _a
In the pattern: x :: _a
In the pattern: [x :: _a]
WildcardsInPatternAndExprSig.hs:4:25: error:
Found
hole: _ :: [w_c]
Where: ‘w_c’ is a rigid type variable bound by
the inferred type of bar :: Maybe [w_c] > w_c > [w_c]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
bar :: Maybe [w_c] > w_c > [w_c]
(bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: _
In the pattern: [x :: _a] :: _
In the pattern: Just ([x :: _a] :: _)
WildcardsInPatternAndExprSig.hs:4:38: error:
Found
hole: _b :: w_c
Where: ‘w_c’ is a rigid type variable bound by
the inferred type of bar :: Maybe [w_c] > w_c > [w_c]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
bar :: Maybe [w_c] > w_c > [w_c]
(bound at WildcardsInPatternAndExprSig.hs:4:1)
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]
WildcardsInPatternAndExprSig.hs:4:49: error:
Found
hole: _c :: w_c
Where: ‘w_c’ is a rigid type variable bound by