Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
obsidiansystems
GHC
Commits
a2abcf6e
Commit
a2abcf6e
authored
Apr 25, 2016
by
Simon Peyton Jones
Browse files
Minor improvement to error message
"One fewer arguments to ..." rather than "One fewer argument to ..."
parent
af6dced9
Changes
12
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcErrors.hs
View file @
a2abcf6e
...
...
@@ -1695,23 +1695,20 @@ mkExpectedActualMsg ty1 ty2 (TypeEqOrigin { uo_actual = act
Just
num_act_args
->
num_act_args
>=
-
n
-- don't report to strip off args that aren't there
->
Just
$
text
"Expecting"
<+>
speakN
(
abs
n
)
<+>
more_or_fewer
<+>
plural_n
(
abs
n
)
(
text
"argument"
)
<+>
text
"to"
<+>
quotes
(
ppr
thing
)
more_or_fewer
<+>
quotes
(
ppr
thing
)
where
more_or_fewer
|
n
<
0
=
text
"fewer"
|
otherwise
=
text
"more"
more_or_fewer
|
n
<
0
=
text
"fewer arguments to"
|
n
==
1
=
text
"more argument to"
|
otherwise
=
text
"more arguments to"
-- n > 1
_
->
Nothing
maybe_num_args_msg
=
case
num_args_msg
of
Nothing
->
empty
Just
m
->
m
count_args
ty
=
count
isVisibleBinder
$
fst
$
splitPiTys
ty
plural_n
1
doc
=
doc
plural_n
_
doc
=
doc
<>
char
's'
expandedTys
=
ppUnless
(
expTy1
`
pickyEqType
`
exp
&&
expTy2
`
pickyEqType
`
act
)
$
vcat
[
text
"Type synonyms expanded:"
...
...
testsuite/tests/deriving/should_fail/drvfail005.stderr
View file @
a2abcf6e
drvfail005.hs:4:13: error:
• Expecting one fewer argument to ‘Show a’
• Expecting one fewer argument
s
to ‘Show a’
Expected kind ‘k0 -> Constraint’,
but ‘Show a’ has kind ‘Constraint’
• In the data declaration for ‘Test’
testsuite/tests/polykinds/T6039.stderr
View file @
a2abcf6e
T6039.hs:5:14: error:
• Expecting one fewer argument to ‘j’
• Expecting one fewer argument
s
to ‘j’
Expected kind ‘* -> *’, but ‘j’ has kind ‘*’
• In the kind ‘j k’
testsuite/tests/th/T3177a.stderr
View file @
a2abcf6e
T3177a.hs:8:8: error:
• Expecting one fewer argument to ‘Int’
• Expecting one fewer argument
s
to ‘Int’
Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
• In the type signature:
f :: Int Int
T3177a.hs:11:6: error:
• Expecting one fewer argument to ‘Int’
• Expecting one fewer argument
s
to ‘Int’
Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
• In the type signature:
g :: Int Int
testsuite/tests/typecheck/should_fail/T11356.stderr
View file @
a2abcf6e
T11356.hs:3:7: error:
• Expecting one fewer argument to ‘T p’
• Expecting one fewer argument
s
to ‘T p’
Expected kind ‘k0 -> Constraint’, but ‘T p’ has kind ‘Constraint’
• In the class declaration for ‘C’
testsuite/tests/typecheck/should_fail/T2994.stderr
View file @
a2abcf6e
...
...
@@ -18,7 +18,7 @@ T2994.hs:13:23: error:
In the instance declaration for ‘MonadReader (Reader' r)’
T2994.hs:15:10: error:
• Expecting one fewer argument to ‘MonadReader r r’
• Expecting one fewer argument
s
to ‘MonadReader r r’
Expected kind ‘(* -> *) -> Constraint’,
but ‘MonadReader r r’ has kind ‘Constraint’
• In the instance declaration for ‘MonadReader r r (Reader' r)’
testsuite/tests/typecheck/should_fail/T4875.stderr
View file @
a2abcf6e
T4875.hs:27:24: error:
• Expecting one fewer argument to ‘r’
• Expecting one fewer argument
s
to ‘r’
Expected kind ‘* -> *’, but ‘r’ has kind ‘*’
• In the type signature:
multiplicities :: r c -> [c]
...
...
testsuite/tests/typecheck/should_fail/T7778.stderr
View file @
a2abcf6e
T7778.hs:3:7: error:
• Expecting one fewer argument to ‘Num Int => Num’
• Expecting one fewer argument
s
to ‘Num Int => Num’
Expected kind ‘* -> Constraint’, but ‘Num Int => Num’ has kind ‘*’
• In the type signature:
v :: ((Num Int => Num) ()) => ()
...
...
testsuite/tests/typecheck/should_fail/tcfail070.stderr
View file @
a2abcf6e
tcfail070.hs:15:15:
Expecting one fewer argument to ‘[Int]’
Expected kind ‘* -> k0’, but ‘[Int]’ has kind ‘*’
In the type ‘[Int] Bool’
In the type declaration for ‘State’
tcfail070.hs:15:15:
error:
•
Expecting one fewer argument
s
to ‘[Int]’
Expected kind ‘* -> k0’, but ‘[Int]’ has kind ‘*’
•
In the type ‘[Int] Bool’
In the type declaration for ‘State’
testsuite/tests/typecheck/should_fail/tcfail078.stderr
View file @
a2abcf6e
tcfail078.hs:5:6: error:
• Expecting one fewer argument to ‘Integer’
• Expecting one fewer argument
s
to ‘Integer’
Expected kind ‘* -> Constraint’, but ‘Integer’ has kind ‘*’
• In the type signature:
f :: Integer i => i
testsuite/tests/typecheck/should_fail/tcfail113.stderr
View file @
a2abcf6e
...
...
@@ -12,7 +12,7 @@ tcfail113.hs:15:8: error:
g :: T Int
tcfail113.hs:18:6: error:
• Expecting one fewer argument to ‘Int’
• Expecting one fewer argument
s
to ‘Int’
Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
• In the type signature:
h :: Int Int
testsuite/tests/typecheck/should_fail/tcfail132.stderr
View file @
a2abcf6e
tcfail132.hs:17:37: error:
Expecting one fewer argument to ‘Object f' f t’
Expected kind ‘* -> * -> * -> *’,
but ‘Object f' f t’ has kind ‘* -> * -> *’
In the first argument of ‘T’, namely ‘Object f' f t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
•
Expecting one fewer argument
s
to ‘Object f' f t’
Expected kind ‘* -> * -> * -> *’,
but ‘Object f' f t’ has kind ‘* -> * -> *’
•
In the first argument of ‘T’, namely ‘Object f' f t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
tcfail132.hs:17:53: error:
Expected kind ‘* -> * -> * -> *’,
but ‘DUnit t’ has kind ‘* -> * -> *’
In the second argument of ‘T’, namely ‘DUnit t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
•
Expected kind ‘* -> * -> * -> *’,
but ‘DUnit t’ has kind ‘* -> * -> *’
•
In the second argument of ‘T’, namely ‘DUnit t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment