mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 09:32:53 -06:00
Don't output "\n **" if helpfulMsg is empty.
This commit is contained in:
@@ -652,13 +652,14 @@ checkEqLType gr g t u trm = do
|
|||||||
helpfulMsg =
|
helpfulMsg =
|
||||||
case (arrows inferredType, arrows expectedType) of
|
case (arrows inferredType, arrows expectedType) of
|
||||||
(0,0) -> pp "" -- None of the types is a function
|
(0,0) -> pp "" -- None of the types is a function
|
||||||
_ -> if expectedType `isLessApplied` inferredType
|
_ -> "\n **" <+>
|
||||||
|
if expectedType `isLessApplied` inferredType
|
||||||
then "Maybe you gave too few arguments to" <+> funName
|
then "Maybe you gave too few arguments to" <+> funName
|
||||||
else pp "Double-check that type signature and number of arguments match."
|
else pp "Double-check that type signature and number of arguments match."
|
||||||
in checkError $ s <+> "type of" <+> term $$
|
in checkError $ s <+> "type of" <+> term $$
|
||||||
"expected:" <+> expectedType $$ -- ppqType t u $$
|
"expected:" <+> expectedType $$ -- ppqType t u $$
|
||||||
"inferred:" <+> inferredType $$ -- ppqType u t
|
"inferred:" <+> inferredType $$ -- ppqType u t
|
||||||
"\n **" <+> helpfulMsg <+> "\n"
|
helpfulMsg
|
||||||
where
|
where
|
||||||
-- count the number of arrows in the prettyprinted term
|
-- count the number of arrows in the prettyprinted term
|
||||||
arrows :: Doc -> Int
|
arrows :: Doc -> Int
|
||||||
|
|||||||
Reference in New Issue
Block a user