on master help sign in
Stop saying expected/actual

solve the problem by changing people’s expectations from “this seems messed up” to “wouldn’t that be a nice feature to add”

commitc1ce03a98c57681afdb9f0030130e3fef178fb0e authorEvan Czaplicki <info@elm-lang.org> dateWed 19 Nov 2014, 16:33 (12 years ago) parent12fe897
1 file changed+7−4
src/Type/State.hs+7−4
src/Type/State.hs+7−4
@@ -54,14 +54,17 @@ addError region hint t1 t2 =
5454 makeError = do
5555 t1' <- pretty <$> toSrcType t1
5656 t2' <- pretty <$> toSrcType t2
57− return . P.vcat $
58− [ P.text "Type error" <+> pretty region <> P.colon
57+ return . foldr ($+$) P.empty $
58+ [ P.text "Type mismatch" <+> pretty region <> P.text "."
5959 , maybe P.empty P.text hint
6060 , P.text ""
6161 , P.nest 8 $ A.getRegionDocs region
6262 , P.text ""
63− , P.text " Expected Type:" <+> t1'
64− , P.text " Actual Type:" <+> t2'
63+ , P.text " Something is causing a mismatch between the following types:"
64+ , P.text ""
65+ , P.nest 8 t1'
66+ , P.text ""
67+ , P.nest 8 t2'
6568 ]
6669
6770switchToPool pool = modifyPool (\_ -> pool)