summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInari Listenmaa <inari.listenmaa@gmail.com>2020-06-04 20:19:06 +0200
committerInari Listenmaa <inari.listenmaa@gmail.com>2020-06-04 20:19:06 +0200
commitdbc7297d80c383d3e43148ac526a792ccfb6bbf5 (patch)
treea7f53c70933b60d1dc15edfa85cf5e6831a31d53
parent414c2a1a5f22b80d538a7e695b028908a5e6502f (diff)
Don't output "\n **" if helpfulMsg is empty.
-rw-r--r--src/compiler/GF/Compile/TypeCheck/RConcrete.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
index dc05788b0..4d194e38b 100644
--- a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
+++ b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
@@ -652,13 +652,14 @@ checkEqLType gr g t u trm = do
helpfulMsg =
case (arrows inferredType, arrows expectedType) of
(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
else pp "Double-check that type signature and number of arguments match."
in checkError $ s <+> "type of" <+> term $$
"expected:" <+> expectedType $$ -- ppqType t u $$
"inferred:" <+> inferredType $$ -- ppqType u t
- "\n **" <+> helpfulMsg <+> "\n"
+ helpfulMsg
where
-- count the number of arrows in the prettyprinted term
arrows :: Doc -> Int