[Git][ghc/ghc][wip/cfuneqcan-refactor] Don't simplify extra-constraint holes

Richard Eisenberg gitlab at gitlab.haskell.org
Fri Oct 30 02:51:40 UTC 2020



Richard Eisenberg pushed to branch wip/cfuneqcan-refactor at Glasgow Haskell Compiler / GHC


Commits:
cd5585da by Richard Eisenberg at 2020-10-29T22:51:26-04:00
Don't simplify extra-constraint holes

- - - - -


30 changed files:

- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Utils/Monad.hs
- testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
- testsuite/tests/partial-sigs/should_compile/SuperCls.stderr
- testsuite/tests/partial-sigs/should_compile/T10403.stderr
- testsuite/tests/partial-sigs/should_compile/T10519.stderr
- testsuite/tests/partial-sigs/should_compile/T11016.stderr
- testsuite/tests/partial-sigs/should_compile/T11670.stderr
- testsuite/tests/partial-sigs/should_compile/T12844.stderr
- testsuite/tests/partial-sigs/should_compile/T12845.stderr
- testsuite/tests/partial-sigs/should_compile/T13482.stderr
- testsuite/tests/partial-sigs/should_compile/T14217.stderr
- testsuite/tests/partial-sigs/should_compile/T14643.stderr
- testsuite/tests/partial-sigs/should_compile/T14643a.stderr
- testsuite/tests/partial-sigs/should_compile/T14715.stderr
- testsuite/tests/partial-sigs/should_compile/T15039a.stderr
- testsuite/tests/partial-sigs/should_compile/T15039b.stderr
- testsuite/tests/partial-sigs/should_compile/T15039c.stderr
- testsuite/tests/partial-sigs/should_compile/T15039d.stderr
- testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
- testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr
- testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr
- testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr
- testsuite/tests/partial-sigs/should_fail/T10999.stderr
- testsuite/tests/partial-sigs/should_fail/T11515.stderr
- testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr
- testsuite/tests/typecheck/should_compile/UnliftedNewtypesUnifySig.hs


Changes:

=====================================
compiler/GHC/Tc/Errors.hs
=====================================
@@ -882,7 +882,10 @@ maybeReportHoleError ctxt hole err
 
 -- Unlike maybeReportError, these "hole" errors are
 -- /not/ suppressed by cec_suppress.  We want to see them!
-maybeReportHoleError ctxt (Hole { hole_sort = TypeHole }) err
+maybeReportHoleError ctxt (Hole { hole_sort = hole_sort }) err
+  | case hole_sort of TypeHole       -> True
+                      ConstraintHole -> True
+                      _              -> False
   -- When -XPartialTypeSignatures is on, warnings (instead of errors) are
   -- generated for holes in partial type signatures.
   -- Unless -fwarn-partial-type-signatures is not on,
@@ -894,7 +897,7 @@ maybeReportHoleError ctxt (Hole { hole_sort = TypeHole }) err
        HoleWarn  -> reportWarning (Reason Opt_WarnPartialTypeSignatures) err
        HoleDefer -> return ()
 
-maybeReportHoleError ctxt hole@(Hole { hole_sort = ExprHole _ }) err
+maybeReportHoleError ctxt hole err
   -- Otherwise this is a typed hole in an expression,
   -- but not for an out-of-scope variable (because that goes through a
   -- different function)
@@ -961,6 +964,8 @@ maybeAddDeferredHoleBinding ctxt err (Hole { hole_sort = ExprHole ev_id })
   = return ()
 maybeAddDeferredHoleBinding _ _ (Hole { hole_sort = TypeHole })
   = return ()
+maybeAddDeferredHoleBinding _ _ (Hole { hole_sort = ConstraintHole })
+  = return ()
 
 tryReporters :: ReportErrCtxt -> [ReporterSpec] -> [Ct] -> TcM (ReportErrCtxt, [Ct])
 -- Use the first reporter in the list whose predicate says True
@@ -1209,6 +1214,9 @@ mkHoleError tidy_simples ctxt hole@(Hole { hole_occ = occ
       TypeHole -> vcat [ hang (text "Found type wildcard" <+> quotes (ppr occ))
                             2 (text "standing for" <+> quotes pp_hole_type_with_kind)
                        , tyvars_msg, type_hole_hint ]
+      ConstraintHole -> vcat [ hang (text "Found extra-constraints wildcard standing for")
+                                  2 (quotes $ pprType hole_ty)  -- always kind constraint
+                             , tyvars_msg, type_hole_hint ]
 
     pp_hole_type_with_kind
       | isLiftedTypeKind hole_kind


=====================================
compiler/GHC/Tc/Gen/HsType.hs
=====================================
@@ -1210,7 +1210,9 @@ tc_hs_type mode ty@(HsAppKindTy{})         ek = tc_infer_hs_type_ek mode ty ek
 tc_hs_type mode ty@(HsOpTy {})             ek = tc_infer_hs_type_ek mode ty ek
 tc_hs_type mode ty@(HsKindSig {})          ek = tc_infer_hs_type_ek mode ty ek
 tc_hs_type mode ty@(XHsType (NHsCoreTy{})) ek = tc_infer_hs_type_ek mode ty ek
-tc_hs_type mode ty@(HsWildCardTy _)        ek = tcAnonWildCardOcc mode ty ek
+
+tc_hs_type mode ty@(HsWildCardTy _)        ek
+  = tcAnonWildCardOcc NoExtraConstraint mode ty ek
 
 {-
 Note [Variable Specificity and Forall Visibility]
@@ -2089,8 +2091,9 @@ newNamedWildTyVar _name   -- Currently ignoring the "_x" wildcard name used in t
        ; return tyvar }
 
 ---------------------------
-tcAnonWildCardOcc :: TcTyMode -> HsType GhcRn -> Kind -> TcM TcType
-tcAnonWildCardOcc (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) })
+tcAnonWildCardOcc :: IsExtraConstraint
+                  -> TcTyMode -> HsType GhcRn -> Kind -> TcM TcType
+tcAnonWildCardOcc is_extra (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) })
                   ty exp_kind
     -- hole_lvl: see Note [Checking partial type signatures]
     --           esp the bullet on nested forall types
@@ -2104,7 +2107,7 @@ tcAnonWildCardOcc (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) })
 
        ; traceTc "tcAnonWildCardOcc" (ppr hole_lvl <+> ppr emit_holes)
        ; when emit_holes $
-         emitAnonTypeHole wc_tv
+         emitAnonTypeHole is_extra wc_tv
          -- Why the 'when' guard?
          -- See Note [Wildcards in visible kind application]
 
@@ -2125,7 +2128,7 @@ tcAnonWildCardOcc (TcTyMode { mode_holes = Just (hole_lvl, hole_mode) })
                      HM_FamPat  -> False
                      HM_VTA     -> False
 
-tcAnonWildCardOcc mode ty _
+tcAnonWildCardOcc _ mode ty _
 -- mode_holes is Nothing.  Should not happen, because renamer
 -- should already have rejected holes in unexpected places
   = pprPanic "tcWildCardOcc" (ppr mode $$ ppr ty)
@@ -3639,7 +3642,7 @@ tcPartialContext mode hs_theta
   | Just (hs_theta1, hs_ctxt_last) <- snocView hs_theta
   , L wc_loc ty@(HsWildCardTy _) <- ignoreParens hs_ctxt_last
   = do { wc_tv_ty <- setSrcSpan wc_loc $
-                     tcAnonWildCardOcc mode ty constraintKind
+                     tcAnonWildCardOcc YesExtraConstraint mode ty constraintKind
        ; theta <- mapM (tc_lhs_pred mode) hs_theta1
        ; return (theta, Just wc_tv_ty) }
   | otherwise


=====================================
compiler/GHC/Tc/Solver.hs
=====================================
@@ -2029,6 +2029,15 @@ simplifyHoles :: Bag Hole -> TcS (Bag Hole)
 simplifyHoles = mapBagM simpl_hole
   where
     simpl_hole :: Hole -> TcS Hole
+
+     -- do not simplify an extra-constraints wildcard. These holes
+     -- are filled with already-simplified constraints in
+     -- chooseInferredQuantifiers (choose_psig_context)
+    simpl_hole h@(Hole { hole_sort = ConstraintHole }) = return h
+
+     -- other wildcards should be simplified for printing
+     -- we must do so here, and not in the error-message generation
+     -- code, because we have all the givens already set up
     simpl_hole h@(Hole { hole_ty = ty, hole_loc = loc })
       = do { ty' <- flattenType loc ty
            ; return (h { hole_ty = ty' }) }


=====================================
compiler/GHC/Tc/Types/Constraint.hs
=====================================
@@ -239,20 +239,23 @@ data HoleSort = ExprHole Id
                  -- will be an erroring expression for -fdefer-type-errors.
               | TypeHole
                  -- ^ A hole in a type (PartialTypeSignatures)
+              | ConstraintHole
+                 -- ^ A hole in a constraint, like @f :: (_, Eq a) => ...
 
 instance Outputable Hole where
   ppr (Hole { hole_sort = ExprHole id
             , hole_occ  = occ
             , hole_ty   = ty })
     = parens $ (braces $ ppr occ <> colon <> ppr id) <+> dcolon <+> ppr ty
-  ppr (Hole { hole_sort = TypeHole
+  ppr (Hole { hole_sort = _other
             , hole_occ  = occ
             , hole_ty   = ty })
     = braces $ ppr occ <> colon <> ppr ty
 
 instance Outputable HoleSort where
-  ppr (ExprHole id) = text "ExprHole:" <> ppr id
-  ppr TypeHole      = text "TypeHole"
+  ppr (ExprHole id)  = text "ExprHole:" <> ppr id
+  ppr TypeHole       = text "TypeHole"
+  ppr ConstraintHole = text "CosntraintHole"
 
 ------------
 -- | Used to indicate extra information about why a CIrredCan is irreducible


=====================================
compiler/GHC/Tc/Utils/Monad.hs
=====================================
@@ -109,7 +109,7 @@ module GHC.Tc.Utils.Monad(
   getTcLevel, setTcLevel, isTouchableTcM,
   getLclTypeEnv, setLclTypeEnv,
   traceTcConstraints,
-  emitNamedTypeHole, emitAnonTypeHole,
+  emitNamedTypeHole, IsExtraConstraint(..), emitAnonTypeHole,
 
   -- * Template Haskell context
   recordThUse, recordThSpliceUse,
@@ -1757,16 +1757,26 @@ traceTcConstraints msg
          hang (text (msg ++ ": LIE:")) 2 (ppr lie)
        }
 
-emitAnonTypeHole :: TcTyVar -> TcM ()
-emitAnonTypeHole tv
+data IsExtraConstraint = YesExtraConstraint
+                       | NoExtraConstraint
+
+instance Outputable IsExtraConstraint where
+  ppr YesExtraConstraint = text "YesExtraConstraint"
+  ppr NoExtraConstraint  = text "NoExtraConstraint"
+
+emitAnonTypeHole :: IsExtraConstraint
+                 -> TcTyVar -> TcM ()
+emitAnonTypeHole extra_constraints tv
   = do { ct_loc <- getCtLocM (TypeHoleOrigin occ) Nothing
-       ; let hole = Hole { hole_sort = TypeHole
+       ; let hole = Hole { hole_sort = sort
                          , hole_occ  = occ
                          , hole_ty   = mkTyVarTy tv
                          , hole_loc  = ct_loc }
        ; emitHole hole }
   where
     occ = mkTyVarOcc "_"
+    sort | YesExtraConstraint <- extra_constraints = ConstraintHole
+         | otherwise                               = TypeHole
 
 emitNamedTypeHole :: (Name, TcTyVar) -> TcM ()
 emitNamedTypeHole (name, tv)


=====================================
testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
=====================================
@@ -65,7 +65,7 @@ SplicesUsed.hs:16:2: warning: [-Wpartial-type-signatures (in -Wdefault)]
     • In the type signature: foo :: _ => _
 
 SplicesUsed.hs:16:2: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Eq a’
+    • Found extra-constraints wildcard standing for ‘Eq a’
       Where: ‘a’ is a rigid type variable bound by
                the inferred type of foo :: Eq a => a -> a -> Bool
                at SplicesUsed.hs:16:2-11


=====================================
testsuite/tests/partial-sigs/should_compile/SuperCls.stderr
=====================================
@@ -1,4 +1,4 @@
 
 SuperCls.hs:4:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
     • In the type signature: f :: (Ord a, _) => a -> Bool


=====================================
testsuite/tests/partial-sigs/should_compile/T10403.stderr
=====================================
@@ -1,6 +1,6 @@
 
 T10403.hs:15:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Functor f’
+    • Found extra-constraints wildcard standing for ‘Functor f’
       Where: ‘f’ is a rigid type variable bound by
                the inferred type of h1 :: Functor f => (a -> a1) -> f a -> H f
                at T10403.hs:17:1-41


=====================================
testsuite/tests/partial-sigs/should_compile/T10519.stderr
=====================================
@@ -1,6 +1,6 @@
 
 T10519.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Eq a’
+    • Found extra-constraints wildcard standing for ‘Eq a’
       Where: ‘a’ is a rigid type variable bound by
                the inferred type of foo :: Eq a => a -> a -> Bool
                at T10519.hs:5:15


=====================================
testsuite/tests/partial-sigs/should_compile/T11016.stderr
=====================================
@@ -1,6 +1,6 @@
 
 T11016.hs:5:19: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
     • In the type signature: f1 :: (?x :: Int, _) => Int
 
 T11016.hs:8:22: warning: [-Wpartial-type-signatures (in -Wdefault)]


=====================================
testsuite/tests/partial-sigs/should_compile/T11670.stderr
=====================================
@@ -9,7 +9,7 @@ T11670.hs:10:42: warning: [-Wpartial-type-signatures (in -Wdefault)]
         peek :: Ptr a -> IO CLong (bound at T11670.hs:10:1)
 
 T11670.hs:13:40: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Storable w’
+    • Found extra-constraints wildcard standing for ‘Storable w’
       Where: ‘w’ is a rigid type variable bound by
                the inferred type of <expression> :: Storable w => IO w
                at T11670.hs:13:40-48


=====================================
testsuite/tests/partial-sigs/should_compile/T12844.stderr
=====================================
@@ -1,7 +1,7 @@
 
 T12844.hs:12:9: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’
-        standing for ‘(Head rngs ~ '(r, r'), Foo rngs)’
+    • Found extra-constraints wildcard standing for
+        ‘(Head rngs ~ '(r, r'), Foo rngs)’
       Where: ‘r’, ‘r'’, ‘k’, ‘k1’, ‘rngs’
                are rigid type variables bound by
                the inferred type of


=====================================
testsuite/tests/partial-sigs/should_compile/T12845.stderr
=====================================
@@ -1,6 +1,6 @@
 
 T12845.hs:18:70: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
     • In the type signature:
         broken :: forall r r' rngs.
                   ('(r, r') ~ Head rngs, Bar r r' ~ 'True, _) =>


=====================================
testsuite/tests/partial-sigs/should_compile/T13482.stderr
=====================================
@@ -1,6 +1,6 @@
 
 T13482.hs:10:32: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘(Eq m, Monoid m)’
+    • Found extra-constraints wildcard standing for ‘(Eq m, Monoid m)’
       Where: ‘m’ is a rigid type variable bound by
                the inferred type of
                  minimal1_noksig :: (Eq m, Monoid m) => Int -> Bool
@@ -9,21 +9,21 @@ T13482.hs:10:32: warning: [-Wpartial-type-signatures (in -Wdefault)]
         minimal1_noksig :: forall m. _ => Int -> Bool
 
 T13482.hs:13:33: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘(Eq m, Monoid m)’
+    • Found extra-constraints wildcard standing for ‘(Eq m, Monoid m)’
       Where: ‘m’ is a rigid type variable bound by
                the inferred type of minimal1 :: (Eq m, Monoid m) => Bool
                at T13482.hs:13:21
     • In the type signature: minimal1 :: forall (m :: Type). _ => Bool
 
 T13482.hs:16:30: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Monoid m’
+    • Found extra-constraints wildcard standing for ‘Monoid m’
       Where: ‘m’ is a rigid type variable bound by
                the inferred type of minimal2 :: (Eq m, Monoid m) => Bool
                at T13482.hs:16:20
     • In the type signature: minimal2 :: forall m. (Eq m, _) => Bool
 
 T13482.hs:19:34: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Eq m’
+    • Found extra-constraints wildcard standing for ‘Eq m’
       Where: ‘m’ is a rigid type variable bound by
                the inferred type of minimal3 :: (Monoid m, Eq m) => Bool
                at T13482.hs:19:20


=====================================
testsuite/tests/partial-sigs/should_compile/T14217.stderr
=====================================
@@ -1,14 +1,14 @@
 
 T14217.hs:32:11: error:
-    • Found type wildcard ‘_’
-        standing for ‘(Eq a1, Eq a2, Eq a3, Eq a4, Eq a5, Eq a6, Eq a7,
-                       Eq a8, Eq a9, Eq a10, Eq a11, Eq a12, Eq a13, Eq a14, Eq a15,
-                       Eq a16, Eq a17, Eq a18, Eq a19, Eq a20, Eq a21, Eq a22, Eq a23,
-                       Eq a24, Eq a25, Eq a26, Eq a27, Eq a28, Eq a29, Eq a30, Eq a31,
-                       Eq a32, Eq a33, Eq a34, Eq a35, Eq a36, Eq a37, Eq a38, Eq a39,
-                       Eq a40, Eq a41, Eq a42, Eq a43, Eq a44, Eq a45, Eq a46, Eq a47,
-                       Eq a48, Eq a49, Eq a50, Eq a51, Eq a52, Eq a53, Eq a54, Eq a55,
-                       Eq a56, Eq a57, Eq a58, Eq a59, Eq a60, Eq a61, Eq a62, Eq a63)’
+    • Found extra-constraints wildcard standing for
+        ‘(Eq a1, Eq a2, Eq a3, Eq a4, Eq a5, Eq a6, Eq a7, Eq a8, Eq a9,
+          Eq a10, Eq a11, Eq a12, Eq a13, Eq a14, Eq a15, Eq a16, Eq a17,
+          Eq a18, Eq a19, Eq a20, Eq a21, Eq a22, Eq a23, Eq a24, Eq a25,
+          Eq a26, Eq a27, Eq a28, Eq a29, Eq a30, Eq a31, Eq a32, Eq a33,
+          Eq a34, Eq a35, Eq a36, Eq a37, Eq a38, Eq a39, Eq a40, Eq a41,
+          Eq a42, Eq a43, Eq a44, Eq a45, Eq a46, Eq a47, Eq a48, Eq a49,
+          Eq a50, Eq a51, Eq a52, Eq a53, Eq a54, Eq a55, Eq a56, Eq a57,
+          Eq a58, Eq a59, Eq a60, Eq a61, Eq a62, Eq a63)’
       Where: ‘a1’, ‘a2’, ‘a3’, ‘a4’, ‘a5’, ‘a6’, ‘a7’, ‘a8’, ‘a9’, ‘a10’,
              ‘a11’, ‘a12’, ‘a13’, ‘a14’, ‘a15’, ‘a16’, ‘a17’, ‘a18’, ‘a19’,
              ‘a20’, ‘a21’, ‘a22’, ‘a23’, ‘a24’, ‘a25’, ‘a26’, ‘a27’, ‘a28’,


=====================================
testsuite/tests/partial-sigs/should_compile/T14643.stderr
=====================================
@@ -1,8 +1,8 @@
 
 T14643.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
     • In the type signature: ag :: (Num a, _) => a -> a
 
 T14643.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
     • In the type signature: af :: (Num a, _) => a -> a


=====================================
testsuite/tests/partial-sigs/should_compile/T14643a.stderr
=====================================
@@ -1,8 +1,8 @@
 
 T14643a.hs:5:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
     • In the type signature: af :: (Num a, _) => a -> a
 
 T14643a.hs:8:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
     • In the type signature: ag :: (Num a, _) => a -> a


=====================================
testsuite/tests/partial-sigs/should_compile/T14715.stderr
=====================================
@@ -1,11 +1,12 @@
 
 T14715.hs:13:53: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Reduce z zq’
-      Where: ‘z’, ‘zq’ are rigid type variables bound by
+    • Found extra-constraints wildcard standing for
+        ‘Reduce (LiftOf zq) zq’
+      Where: ‘zq’ is a rigid type variable bound by
                the inferred type of
                  bench_mulPublic :: (z ~ LiftOf zq, Reduce (LiftOf zq) zq) =>
                                     Cyc zp -> Cyc z -> IO (zp, zq)
-               at T14715.hs:13:27-33
+               at T14715.hs:13:32-33
     • In the type signature:
         bench_mulPublic :: forall z zp zq.
                            (z ~ LiftOf zq, _) => Cyc zp -> Cyc z -> IO (zp, zq)


=====================================
testsuite/tests/partial-sigs/should_compile/T15039a.stderr
=====================================
@@ -48,7 +48,7 @@ T15039a.hs:33:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
         ex6 :: Dict (Coercible a b) -> () (bound at T15039a.hs:33:1)
 
 T15039a.hs:35:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Coercible a b’
+    • Found extra-constraints wildcard standing for ‘Coercible a b’
       Where: ‘a’, ‘b’ are rigid type variables bound by
                the inferred type of ex7 :: Coercible a b => Coercion a b
                at T15039a.hs:35:1-44


=====================================
testsuite/tests/partial-sigs/should_compile/T15039b.stderr
=====================================
@@ -49,7 +49,8 @@ T15039b.hs:33:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
         ex6 :: Dict (Coercible @(*) a b) -> () (bound at T15039b.hs:33:1)
 
 T15039b.hs:35:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Coercible @(*) a b’
+    • Found extra-constraints wildcard standing for
+        ‘Coercible @(*) a b’
       Where: ‘a’, ‘b’ are rigid type variables bound by
                the inferred type of ex7 :: Coercible @(*) a b => Coercion @{*} a b
                at T15039b.hs:35:1-44


=====================================
testsuite/tests/partial-sigs/should_compile/T15039c.stderr
=====================================
@@ -48,7 +48,7 @@ T15039c.hs:33:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
         ex6 :: Dict (Coercible a b) -> () (bound at T15039c.hs:33:1)
 
 T15039c.hs:35:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Coercible a b’
+    • Found extra-constraints wildcard standing for ‘Coercible a b’
       Where: ‘a’, ‘b’ are rigid type variables bound by
                the inferred type of ex7 :: Coercible a b => Coercion a b
                at T15039c.hs:35:1-44


=====================================
testsuite/tests/partial-sigs/should_compile/T15039d.stderr
=====================================
@@ -50,7 +50,8 @@ T15039d.hs:33:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
         ex6 :: Dict (Coercible @(*) a b) -> () (bound at T15039d.hs:33:1)
 
 T15039d.hs:35:8: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Coercible @(*) a b’
+    • Found extra-constraints wildcard standing for
+        ‘Coercible @(*) a b’
       Where: ‘a’, ‘b’ are rigid type variables bound by
                the inferred type of ex7 :: Coercible @(*) a b => Coercion @{*} a b
                at T15039d.hs:35:1-44


=====================================
testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
=====================================
@@ -2,7 +2,7 @@ TYPE SIGNATURES
   bar :: forall {t} {w}. t -> (t -> w) -> w
   foo :: forall {a}. (Show a, Enum a) => a -> String
 Dependent modules: []
-Dependent packages: [base-4.14.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
+Dependent packages: [base-4.15.0.0, ghc-bignum-1.0, ghc-prim-0.7.0]
 
 WarningWildcardInstantiations.hs:5:14: warning: [-Wpartial-type-signatures (in -Wdefault)]
     • Found type wildcard ‘_a’ standing for ‘a’
@@ -12,7 +12,7 @@ WarningWildcardInstantiations.hs:5:14: warning: [-Wpartial-type-signatures (in -
     • In the type signature: foo :: (Show _a, _) => _a -> _
 
 WarningWildcardInstantiations.hs:5:18: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Enum a’
+    • Found extra-constraints wildcard standing for ‘Enum a’
       Where: ‘a’ is a rigid type variable bound by
                the inferred type of foo :: (Show a, Enum a) => a -> String
                at WarningWildcardInstantiations.hs:6:1-21


=====================================
testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardInExpressionSignature.stderr
=====================================
@@ -1,6 +1,6 @@
 
 ExtraConstraintsWildcardInExpressionSignature.hs:5:20: warning: [-Wpartial-type-signatures (in -Wdefault)]
-    • Found type wildcard ‘_’ standing for ‘Eq a1’
+    • Found extra-constraints wildcard standing for ‘Eq a1’
       Where: ‘a1’ is a rigid type variable bound by
                the inferred type of <expression> :: Eq a1 => a1 -> a1 -> Bool
                at ExtraConstraintsWildcardInExpressionSignature.hs:5:20-25


=====================================
testsuite/tests/partial-sigs/should_fail/ExtraConstraintsWildcardNotEnabled.stderr
=====================================
@@ -1,6 +1,6 @@
 
 ExtraConstraintsWildcardNotEnabled.hs:4:10: error:
-    • Found type wildcard ‘_’ standing for ‘Show a’
+    • Found extra-constraints wildcard standing for ‘Show a’
       Where: ‘a’ is a rigid type variable bound by
                the inferred type of show' :: Show a => a -> String
                at ExtraConstraintsWildcardNotEnabled.hs:4:1-25


=====================================
testsuite/tests/partial-sigs/should_fail/InstantiatedNamedWildcardsInConstraints.stderr
=====================================
@@ -8,7 +8,7 @@ InstantiatedNamedWildcardsInConstraints.hs:4:14: error:
     • In the type signature: foo :: (Enum _a, _) => _a -> (String, b)
 
 InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
-    • Found type wildcard ‘_’ standing for ‘Show b’
+    • Found extra-constraints wildcard standing for ‘Show b’
       Where: ‘b’ is a rigid type variable bound by
                the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
                at InstantiatedNamedWildcardsInConstraints.hs:4:1-40


=====================================
testsuite/tests/partial-sigs/should_fail/T10999.stderr
=====================================
@@ -1,6 +1,6 @@
 
 T10999.hs:5:6: error:
-    • Found type wildcard ‘_’ standing for ‘Ord a’
+    • Found extra-constraints wildcard standing for ‘Ord a’
       Where: ‘a’ is a rigid type variable bound by
                the inferred type of f :: Ord a => () -> Set.Set a
                at T10999.hs:6:1-28


=====================================
testsuite/tests/partial-sigs/should_fail/T11515.stderr
=====================================
@@ -1,5 +1,5 @@
 
 T11515.hs:7:20: error:
-    • Found type wildcard ‘_’ standing for ‘()’
+    • Found extra-constraints wildcard standing for ‘()’
       To use the inferred type, enable PartialTypeSignatures
     • In the type signature: foo :: (ShowSyn a, _) => a -> String


=====================================
testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr
=====================================
@@ -8,7 +8,7 @@ WildcardInstantiations.hs:5:14: error:
     • In the type signature: foo :: (Show _a, _) => _a -> _
 
 WildcardInstantiations.hs:5:18: error:
-    • Found type wildcard ‘_’ standing for ‘Enum a’
+    • Found extra-constraints wildcard standing for ‘Enum a’
       Where: ‘a’ is a rigid type variable bound by
                the inferred type of foo :: (Show a, Enum a) => a -> String
                at WildcardInstantiations.hs:6:1-21


=====================================
testsuite/tests/typecheck/should_compile/UnliftedNewtypesUnifySig.hs
=====================================
@@ -20,4 +20,4 @@ data family D (a :: TYPE r) :: TYPE r
 newtype instance D a = MkWordD Word#
 
 newtype instance D a :: TYPE (KindOf a) where
-  MkIntD :: forall (a :: TYPE 'IntRep). Int# -> D a
+  MkIntD :: forall a. Int# -> D a



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cd5585dafd49f5fa35bc2d14a92c2c40c45c34a7
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/20201029/8d1a922a/attachment-0001.html>


More information about the ghc-commits mailing list