[Git][ghc/ghc][wip/T21623] Wibbles

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Mon Aug 22 15:18:42 UTC 2022



Simon Peyton Jones pushed to branch wip/T21623 at Glasgow Haskell Compiler / GHC


Commits:
e7cf241c by Simon Peyton Jones at 2022-08-22T16:19:13+01:00
Wibbles

- - - - -


3 changed files:

- compiler/GHC/Tc/Errors/Ppr.hs
- testsuite/tests/typecheck/should_fail/tcfail212.stderr
- testsuite/tests/typecheck/should_fail/tcfail215.stderr


Changes:

=====================================
compiler/GHC/Tc/Errors/Ppr.hs
=====================================
@@ -2142,21 +2142,22 @@ pprTcSolverReportMsg ctxt
         pp_exp_thing = case exp_torc of TypeLike       -> text "type";
                                         ConstraintLike -> text "constraint"
 
-        -- (TYPE (BoxedRep lev1)) ~ (TYPE (BoxedRep lev2))
+        -- (TYPE (BoxedRep lev1)) ~ (TYPE (BoxedRep lev2)); or CONSTRAINT ditto
         msg_for_same_rep exp_rr_args act_rr_args
           | [exp_lev_ty] <- exp_rr_args     -- BoxedRep has exactly one arg
           , [act_lev_ty] <- act_rr_args
           , Just exp_lev <- levityType_maybe exp_lev_ty
           , Just act_lev <- levityType_maybe act_lev_ty
-          = sep [ text "Expecting" <+> ppr_an_lev exp_lev <+> pp_exp_thing <+> text "but"
+          = sep [ text "Expected" <+> ppr_an_lev exp_lev <+> pp_exp_thing <> text ", but"
                 , case mb_thing of
                      Just thing -> quotes (ppr thing) <+> text "is" <+> ppr_lev act_lev
                      Nothing    -> text "got" <+> ppr_an_lev act_lev <+> pp_exp_thing ]
         msg_for_same_rep _ _
           = bale_out_msg
 
+        -- (TYPE (BoxedRep lev)) ~ (TYPE IntRep); or CONSTRAINT ditto
         msg_for_different_rep exp_rr_tc act_rr_tc
-          = sep [ text "Expecting a" <+> what <+> text "but"
+          = sep [ text "Expected a" <+> what <> text ", but"
                 , case mb_thing of
                      Just thing -> quotes (ppr thing)
                      Nothing    -> quotes (pprWithTYPE act)


=====================================
testsuite/tests/typecheck/should_fail/tcfail212.stderr
=====================================
@@ -10,9 +10,9 @@ tcfail212.hs:10:14: error:
     • In the type signature: f :: (Maybe, Either Int)
 
 tcfail212.hs:13:7: error:
-    • Expecting a lifted type, but ‘Int#’ is unlifted
+    • Expected a boxed type, but ‘Int#’ has representation ‘IntRep’
     • In the type signature: g :: (Int#, Int#)
 
 tcfail212.hs:13:13: error:
-    • Expecting a lifted type, but ‘Int#’ is unlifted
+    • Expected a boxed type, but ‘Int#’ has representation ‘IntRep’
     • In the type signature: g :: (Int#, Int#)


=====================================
testsuite/tests/typecheck/should_fail/tcfail215.stderr
=====================================
@@ -1,5 +1,4 @@
 
 tcfail215.hs:8:15: error:
-    • Expecting a lifted type, but ‘Int#’ is unlifted
-    • In the type signature:
-        foo :: (?x :: Int#) => Int
+    • Expected a boxed type, but ‘Int#’ has representation ‘IntRep’
+    • In the type signature: foo :: (?x :: Int#) => Int



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e7cf241ce262e210f39458bff72f3031dafecd5e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e7cf241ce262e210f39458bff72f3031dafecd5e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20220822/71ae26a4/attachment-0001.html>


More information about the ghc-commits mailing list