[Git][ghc/ghc][wip/T22194-flags] More wibbles

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Mar 15 23:20:52 UTC 2023



Simon Peyton Jones pushed to branch wip/T22194-flags at Glasgow Haskell Compiler / GHC


Commits:
440df186 by Simon Peyton Jones at 2023-03-15T23:22:23+00:00
More wibbles

- - - - -


19 changed files:

- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Utils/Concrete.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- testsuite/tests/indexed-types/should_fail/T8518.stderr
- testsuite/tests/partial-sigs/should_compile/T10403.stderr
- testsuite/tests/partial-sigs/should_fail/T14584.stderr
- testsuite/tests/polykinds/T14939.hs
- − testsuite/tests/polykinds/T18451a.stderr
- testsuite/tests/rep-poly/T13929.stderr
- testsuite/tests/typecheck/should_compile/PolytypeDecomp.stderr
- testsuite/tests/typecheck/should_compile/T13651.stderr
- testsuite/tests/typecheck/should_fail/T16512a.stderr
- testsuite/tests/typecheck/should_fail/T7869.stderr


Changes:

=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -596,9 +596,9 @@ tryCastWorkerWrapper env bind_cxt old_bndr occ_info bndr (Cast rhs co)
                         --            a DFunUnfolding in mk_worker_unfolding
   , not (exprIsTrivial rhs)        -- Not x = y |> co; Wrinkle 1
   , not (hasInlineUnfolding info)  -- Not INLINE things: Wrinkle 4
-  , isConcrete (typeKind work_ty)  -- Don't peel off a cast if doing so would
-                                   -- lose the underlying runtime representation.
-                                   -- See Note [Preserve RuntimeRep info in cast w/w]
+  , isConcreteType (typeKind work_ty) -- Don't peel off a cast if doing so would
+                                      -- lose the underlying runtime representation.
+                                      -- See Note [Preserve RuntimeRep info in cast w/w]
   , not (isOpaquePragma (idInlinePragma old_bndr)) -- Not for OPAQUE bindings
                                                    -- See Note [OPAQUE pragma]
   = do  { uniq <- getUniqueM


=====================================
compiler/GHC/Core/Type.hs
=====================================
@@ -233,7 +233,7 @@ module GHC.Core.Type (
 
         -- * Kinds
         isTYPEorCONSTRAINT,
-        isConcrete, isFixedRuntimeRepKind,
+        isConcreteType, isFixedRuntimeRepKind,
     ) where
 
 import GHC.Prelude
@@ -2755,28 +2755,26 @@ argsHaveFixedRuntimeRep ty
     (bndrs, _) = splitPiTys ty
 
 -- | Checks that a kind of the form 'Type', 'Constraint'
--- or @'TYPE r@ is concrete. See 'isConcrete'.
+-- or @'TYPE r@ is concrete. See 'isConcreteType'.
 --
 -- __Precondition:__ The type has kind `TYPE blah` or `CONSTRAINT blah`
 isFixedRuntimeRepKind :: HasDebugCallStack => Kind -> Bool
 isFixedRuntimeRepKind k
   = assertPpr (isTYPEorCONSTRAINT k) (ppr k) $
     -- the isLiftedTypeKind check is necessary b/c of Constraint
-    isConcrete k
+    isConcreteType k
 
 -- | Tests whether the given type is concrete, i.e. it
 -- whether it consists only of concrete type constructors,
 -- concrete type variables, and applications.
 --
 -- See Note [Concrete types] in GHC.Tc.Utils.Concrete.
-isConcrete :: Type -> Bool
-isConcrete = go
+isConcreteType :: Type -> Bool
+isConcreteType = go
   where
     go (TyVarTy tv)        = isConcreteTyVar tv
     go (AppTy ty1 ty2)     = go ty1 && go ty2
-    go (TyConApp tc tys)  -- Works for synonyms too
-      | isConcreteTyCon tc = all go tys
-      | otherwise          = False
+    go (TyConApp tc tys)   = go_tc tc tys
     go ForAllTy{}          = False
     go (FunTy _ w t1 t2)   =  go w
                            && go (typeKind t1) && go t1
@@ -2785,6 +2783,21 @@ isConcrete = go
     go CastTy{}            = False
     go CoercionTy{}        = False
 
+    go_tc tc tys
+      | isForgetfulSynTyCon tc  -- E.g. type S a = Int
+                                -- Then (S x) is concrete even if x isn't
+      , Just ty' <- expandSynTyConApp_maybe tc tys
+      = go ty'
+
+      -- Apart from forgetful synonyms, isConcreteTyCon
+      -- is enough; no need to expand.  This is good for e.g
+      --      type LiftedRep = BoxedRep Lifted
+      | isConcreteTyCon tc
+      = all go tys
+
+      | otherwise  -- E.g. type families
+      = False
+
 
 {-
 %************************************************************************


=====================================
compiler/GHC/Tc/Errors.hs
=====================================
@@ -1537,13 +1537,9 @@ any more.  So we don't assert that it is.
 -- Don't have multiple equality errors from the same location
 -- E.g.   (Int,Bool) ~ (Bool,Int)   one error will do!
 mkEqErr :: SolverReportErrCtxt -> NonEmpty ErrorItem -> TcM SolverReport
-mkEqErr ctxt items@(item:|_)
-  | item:_ <- filter (not . ei_suppress) (toList items)
-  = mkEqErr1 ctxt item
-
-  | otherwise  -- they're all suppressed. still need an error message
-                     -- for -fdefer-type-errors though
-  = mkEqErr1 ctxt item
+mkEqErr ctxt items
+  | item1 :| _ <- tryFilter (not . ei_suppress) items
+  = mkEqErr1 ctxt item1
 
 mkEqErr1 :: SolverReportErrCtxt -> ErrorItem -> TcM SolverReport
 mkEqErr1 ctxt item   -- Wanted only
@@ -1609,9 +1605,8 @@ mkEqErr_help ctxt item ty1 ty2
   | Just casted_tv2 <- getCastedTyVar_maybe ty2
   = mkTyVarEqErr ctxt item casted_tv2 ty1
   | otherwise
-  = do
-    err <- reportEqErr ctxt item ty1 ty2
-    return (err, noHints)
+  = do { err <- reportEqErr ctxt item ty1 ty2
+       ; return (err, noHints) }
 
 reportEqErr :: SolverReportErrCtxt
             -> ErrorItem
@@ -1658,8 +1653,8 @@ mkTyVarEqErr' ctxt item (tv1, co1) ty2
       (_, infos) <- zonkTidyFRRInfos (cec_tidy ctxt) [frr_info]
       return (FixedRuntimeRepError infos, [])
 
-  -- Impredicativity is a simple error to understand; try it before
-  -- anything more complicated.
+  -- Impredicativity is a simple error to understand;
+  -- try it before anything more complicated.
   | check_eq_result `cterHasProblem` cteImpredicative
   = do
     tyvar_eq_info <- extraTyVarEqInfo (tv1, Nothing) ty2
@@ -1679,6 +1674,12 @@ mkTyVarEqErr' ctxt item (tv1, co1) ty2
         -- to be helpful since this is just an unimplemented feature.
     return (main_msg, [])
 
+  -- Incompatible kinds
+  -- This is wrinkle (4) in Note [Equalities with incompatible kinds] in
+  -- GHC.Tc.Solver.Canonical
+  | hasCoercionHoleCo co1 || hasCoercionHoleTy ty2
+  = return (mkBlockedEqErr item, [])
+
   | isSkolemTyVar tv1  -- ty2 won't be a meta-tyvar; we would have
                        -- swapped in Solver.Canonical.canEqTyVarHomo
     || isTyVarTyVar tv1 && not (isTyVarTy ty2)
@@ -1718,11 +1719,6 @@ mkTyVarEqErr' ctxt item (tv1, co1) ty2
 
     in return (main_msg, [])
 
-    -- This is wrinkle (4) in Note [Equalities with incompatible kinds] in
-    -- GHC.Tc.Solver.Canonical
-  | hasCoercionHoleCo co1 || hasCoercionHoleTy ty2
-  = return (mkBlockedEqErr item, [])
-
   -- If the immediately-enclosing implication has 'tv' a skolem, and
   -- we know by now its an InferSkol kind of skolem, then presumably
   -- it started life as a TyVarTv, else it'd have been unified, given
@@ -1786,7 +1782,7 @@ mkTyVarEqErr' ctxt item (tv1, co1) ty2
     -- there is an error is not sufficient. See #21430.
     mb_concrete_reason
       | Just frr_orig <- isConcreteTyVar_maybe tv1
-      , not (isConcrete ty2)
+      , not (isConcreteType ty2)
       = Just $ frr_reason frr_orig tv1 ty2
       | Just (tv2, frr_orig) <- isConcreteTyVarTy_maybe ty2
       , not (isConcreteTyVar tv1)


=====================================
compiler/GHC/Tc/Errors/Ppr.hs
=====================================
@@ -2844,7 +2844,7 @@ pprTcSolverReportMsg _ (FixedRuntimeRepError frr_origs) =
         CastTy inner_ty _
           -- A confusing cast is one that is responsible
           -- for a representation-polymorphism error.
-          -> isConcrete (typeKind inner_ty)
+          -> isConcreteType (typeKind inner_ty)
         _ -> False
 
     type_printout :: Type -> SDoc


=====================================
compiler/GHC/Tc/Solver/Equality.hs
=====================================
@@ -1807,10 +1807,18 @@ swapAndFinish ev eq_rel swapped lhs_tv can_rhs
 tryIrredInstead :: CheckTyEqResult -> CtEvidence -> EqRel -> SwapFlag
                 -> CanEqLHS -> TcType -> TcS (StopOrContinue Ct)
 -- We have a non-canonical equality
--- No need to swap; just hand it off
-tryIrredInstead reason ev _eq_rel _swapped lhs rhs
+-- We still swap it 'swapped' sayso, so that it is oriented
+-- in the direction that the error message reporting machinery
+-- expects it; e.g.  (m ~ t m) rather than (t m ~ m)
+-- This is not very important, and only affects error reporting.
+tryIrredInstead reason ev eq_rel swapped lhs rhs
   = do { traceTcS "cantMakeCanonical" (ppr reason $$ ppr lhs $$ ppr rhs)
-       ; solveIrredEquality (NonCanonicalReason reason) ev }
+       ; new_ev <- rewriteEqEvidence emptyRewriterSet ev swapped
+                       (mkReflRedn role (canEqLHSType lhs))
+                       (mkReflRedn role rhs)
+       ; solveIrredEquality (NonCanonicalReason reason) new_ev }
+  where
+    role = eqRelRole eq_rel
 
 -----------------------
 -- | Solve a reflexive equality constraint


=====================================
compiler/GHC/Tc/Types/Constraint.hs
=====================================
@@ -1224,11 +1224,11 @@ nonDefaultableTyVarsOfWC (WC { wc_simple = simples, wc_impl = implics, wc_errors
           EqPred NomEq lhs rhs
             | Just tv <- getTyVar_maybe lhs
             , isConcreteTyVar tv
-            , not (isConcrete rhs)
+            , not (isConcreteType rhs)
             -> unitVarSet tv
             | Just tv <- getTyVar_maybe rhs
             , isConcreteTyVar tv
-            , not (isConcrete lhs)
+            , not (isConcreteType lhs)
             -> unitVarSet tv
           _ -> emptyVarSet
 


=====================================
compiler/GHC/Tc/Utils/Concrete.hs
=====================================
@@ -22,7 +22,7 @@ import GHC.Core.Coercion       ( coToMCo, mkCastTyMCo
                                , mkGReflRightMCo, mkNomReflCo )
 import GHC.Core.TyCo.Rep       ( Type(..), MCoercion(..) )
 import GHC.Core.TyCon          ( isConcreteTyCon )
-import GHC.Core.Type           ( isConcrete, typeKind, tyVarKind, coreView
+import GHC.Core.Type           ( isConcreteType, typeKind, tyVarKind, coreView
                                , mkTyVarTy, mkTyConApp, mkFunTy, mkAppTy )
 
 import GHC.Tc.Types            ( TcM, ThStage(..), PendingStuff(..) )
@@ -83,7 +83,7 @@ as a central point of reference for this topic.
     Note [The Concrete mechanism]
 
     Instead of simply checking that a type `ty` is concrete (i.e. computing
-    'isConcrete`), we emit an equality constraint:
+    'isConcreteType`), we emit an equality constraint:
 
        co :: ty ~# concrete_ty
 
@@ -179,7 +179,7 @@ Definition: a type is /concrete/ iff it is:
             - a concrete type constructor (as defined below), or
             - a concrete type variable (see Note [ConcreteTv] below), or
             - an application of a concrete type to another concrete type
-GHC.Core.Type.isConcrete checks whether a type meets this definition.
+GHC.Core.Type.isConcreteType checks whether a type meets this definition.
 
 Definition: a /concrete type constructor/ is defined by
             - a promoted data constructor
@@ -634,7 +634,7 @@ makeTypeConcrete conc_orig ty =
     go ty
       | Just ty <- coreView ty
       = go ty
-      | isConcrete ty
+      | isConcreteType ty
       = pure ty
     go ty@(TyVarTy tv) -- not a ConcreteTv (already handled above)
       = do { mb_filled <- lift $ isFilledMetaTyVar_maybe tv


=====================================
compiler/GHC/Tc/Utils/TcMType.hs
=====================================
@@ -843,7 +843,7 @@ cloneTyVarTyVar name kind
 -- This is checked with an assertion.
 newConcreteTyVar :: HasDebugCallStack => ConcreteTvOrigin -> TcKind -> TcM TcTyVar
 newConcreteTyVar reason kind =
-  assertPpr (isConcrete kind)
+  assertPpr (isConcreteType kind)
     (text "newConcreteTyVar: non-concrete kind" <+> ppr kind)
   $ newAnonMetaTyVar (ConcreteTv reason) kind
 


=====================================
compiler/GHC/Tc/Utils/Unify.hs
=====================================
@@ -2538,7 +2538,7 @@ uTypeCheckTouchableTyVarEq lhs_tv rhs
                              return (PuOK (reductionReducedType redn) emptyBag) }
   where
     flags | MetaTv { mtv_info = tv_info, mtv_tclvl = tv_lvl } <- tcTyVarDetails lhs_tv
-          = TEF { tef_foralls  = False
+          = TEF { tef_foralls  = isRuntimeUnkSkol lhs_tv
                 , tef_fam_app  = TEFA_Fail
                 , tef_unifying = Unifying tv_info tv_lvl LC_None
                 , tef_lhs      = TyVarLHS lhs_tv


=====================================
testsuite/tests/indexed-types/should_fail/T8518.stderr
=====================================
@@ -18,8 +18,8 @@ T8518.hs:14:18: error: [GHC-83865]
         callCont :: c -> Z c -> B c -> Maybe (F c) (bound at T8518.hs:14:1)
 
 T8518.hs:17:9: error: [GHC-83865]
-    • Couldn't match type: F t2
-                     with: Z t2 -> B t2 -> F t2
+    • Couldn't match type: Z t2 -> B t2 -> F t2
+                     with: F t2
       Expected: t1 -> t2 -> F t2
         Actual: t1 -> t2 -> Z t2 -> B t2 -> F t2
     • In an equation for ‘callCont’:


=====================================
testsuite/tests/partial-sigs/should_compile/T10403.stderr
=====================================
@@ -15,39 +15,22 @@ T10403.hs:16:12: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)]
 
 T10403.hs:20:7: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)]
     • Found type wildcard ‘_’
-        standing for ‘(a1 -> a2) -> f0 a1 -> H f0’
-      Where: ‘f0’ is an ambiguous type variable
+        standing for ‘(a1 -> a2) -> B t0 a1 -> H (B t0)’
+      Where: ‘t0’ is an ambiguous type variable
              ‘a2’, ‘a1’ are rigid type variables bound by
-               the inferred type of h2 :: (a1 -> a2) -> f0 a1 -> H f0
+               the inferred type of h2 :: (a1 -> a2) -> B t0 a1 -> H (B t0)
                at T10403.hs:23:1-41
     • In the type signature: h2 :: _
 
-T10403.hs:23:15: warning: [GHC-39999] [-Wdeferred-type-errors (in -Wdefault)]
-    • Ambiguous type variable ‘f0’ arising from a use of ‘fmap’
-      prevents the constraint ‘(Functor f0)’ from being solved.
-      Relevant bindings include
-        b :: f0 a1 (bound at T10403.hs:23:6)
-        h2 :: (a1 -> a2) -> f0 a1 -> H f0 (bound at T10403.hs:23:1)
-      Probable fix: use a type annotation to specify what ‘f0’ should be.
-      Potentially matching instances:
-        instance Functor IO -- Defined in ‘GHC.Base’
-        instance Functor (B t) -- Defined at T10403.hs:11:10
-        ...plus 8 others
-        ...plus one instance involving out-of-scope types
-        (use -fprint-potential-instances to see them all)
-    • In the second argument of ‘(.)’, namely ‘fmap (const ())’
-      In the expression: (H . fmap (const ())) (fmap f b)
-      In an equation for ‘h2’: h2 f b = (H . fmap (const ())) (fmap f b)
-
 T10403.hs:29:8: warning: [GHC-46956] [-Wdeferred-type-errors (in -Wdefault)]
-    • Couldn't match type ‘f0’ with ‘B t’
+    • Couldn't match type ‘t0’ with ‘t’
       Expected: H (B t)
-        Actual: H f0
-    • because type variable ‘t’ would escape its scope
-    This (rigid, skolem) type variable is bound by
-      the type signature for:
-        app2 :: forall t. H (B t)
-      at T10403.hs:28:1-15
+        Actual: H (B t0)
+        because type variable ‘t’ would escape its scope
+      This (rigid, skolem) type variable is bound by
+        the type signature for:
+          app2 :: forall t. H (B t)
+        at T10403.hs:28:1-15
     • In the expression: h2 (H . I) (B ())
       In an equation for ‘app2’: app2 = h2 (H . I) (B ())
     • Relevant bindings include


=====================================
testsuite/tests/partial-sigs/should_fail/T14584.stderr
=====================================
@@ -11,7 +11,7 @@ T14584.hs:57:41: warning: [GHC-39999] [-Wdeferred-type-errors (in -Wdefault)]
         act @_ @_ @act (fromSing @m (sing @m @a :: Sing _))
 
 T14584.hs:57:41: warning: [GHC-06200] [-Wdeferred-type-errors (in -Wdefault)]
-    • Cannot use equality for substitution: a0 ~ a
+    • Cannot use equality for substitution: a ~ a0
       Doing so would be ill-kinded.
     • In the second argument of ‘fromSing’, namely
         ‘(sing @m @a :: Sing _)’


=====================================
testsuite/tests/polykinds/T14939.hs
=====================================
@@ -12,8 +12,10 @@ newtype Frí (cls::Type -> Constraint) :: (Type -> Alg cls Type) where
   Frí :: { with :: forall x. cls x => (a -> x) -> x }
       -> Frí cls a
 
+{-
 data AlgCat (cls::Type -> Constraint) :: Cat (Alg cls Type) where
   AlgCat :: (cls a, cls b) => (a -> b) -> AlgCat cls a b
 
 leftAdj :: AlgCat cls (Frí cls a) b -> (a -> b)
-leftAdj (AlgCat f) a = undefined
\ No newline at end of file
+leftAdj (AlgCat f) a = undefined
+-}
\ No newline at end of file


=====================================
testsuite/tests/polykinds/T18451a.stderr deleted
=====================================
@@ -1,7 +0,0 @@
-
-T18451a.hs:11:15: error: [GHC-97739]
-    • These kind and type variables: a b (c :: Const Type b)
-      are out of dependency order. Perhaps try this ordering:
-        (b :: k) (a :: Const (*) b) (c :: Const (*) b)
-    • In the type signature:
-        foo :: forall a b (c :: Const Type b). Proxy '[a, c]


=====================================
testsuite/tests/rep-poly/T13929.stderr
=====================================
@@ -3,7 +3,7 @@ T13929.hs:29:24: error: [GHC-55287]
     • The tuple argument in first position
       does not have a fixed runtime representation.
       Its type is:
-        a0 :: TYPE c0
+        GUnboxed f LiftedRep :: TYPE c0
       Cannot unify ‘rf’ with the type variable ‘c0’
       because it is not a concrete ‘RuntimeRep’.
     • In the expression: (# gunbox x, gunbox y #)
@@ -12,6 +12,7 @@ T13929.hs:29:24: error: [GHC-55287]
       In the instance declaration for
         ‘GUnbox (f :*: g) (TupleRep [rf, rg])’
     • Relevant bindings include
+        x :: f p (bound at T13929.hs:29:13)
         gunbox :: (:*:) f g p -> GUnboxed (f :*: g) (TupleRep [rf, rg])
           (bound at T13929.hs:29:5)
 


=====================================
testsuite/tests/typecheck/should_compile/PolytypeDecomp.stderr
=====================================
@@ -8,13 +8,3 @@ PolytypeDecomp.hs:30:17: error: [GHC-91028]
     • In the expression: x
       In the first argument of ‘myLength’, namely ‘[x, f]’
       In the expression: myLength [x, f]
-
-PolytypeDecomp.hs:30:19: error: [GHC-91028]
-    • Couldn't match type ‘a0’ with ‘[forall a. Maybe a]’
-      Expected: Id a0
-        Actual: [forall a. F [a]]
-      Cannot instantiate unification variable ‘a0’
-      with a type involving polytypes: [forall a. Maybe a]
-    • In the expression: f
-      In the first argument of ‘myLength’, namely ‘[x, f]’
-      In the expression: myLength [x, f]


=====================================
testsuite/tests/typecheck/should_compile/T13651.stderr
=====================================
@@ -1,6 +1,6 @@
 
 T13651.hs:12:8: error: [GHC-25897]
-    • Could not deduce ‘cs ~ Bar (Foo h) (Foo s)’
+    • Could not deduce ‘cr ~ Bar h (Foo r)’
       from the context: (F cr cu ~ Bar h (Bar r u),
                          F cu cs ~ Bar (Foo h) (Bar u s))
         bound by the type signature for:
@@ -8,7 +8,7 @@ T13651.hs:12:8: error: [GHC-25897]
                           (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) =>
                           Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs)
         at T13651.hs:(12,8)-(14,65)
-      ‘cs’ is a rigid type variable bound by
+      ‘cr’ is a rigid type variable bound by
         the type signature for:
           foo :: forall cr cu h r u cs s.
                  (F cr cu ~ Bar h (Bar r u), F cu cs ~ Bar (Foo h) (Bar u s)) =>


=====================================
testsuite/tests/typecheck/should_fail/T16512a.stderr
=====================================
@@ -1,20 +1,18 @@
 
 T16512a.hs:41:25: error: [GHC-25897]
-    • Couldn't match type ‘as’ with ‘a : as’
+    • Couldn't match type ‘b’ with ‘a -> b’
       Expected: AST (ListVariadic (a : as) b)
         Actual: AST (ListVariadic as (a -> b))
-      ‘as’ is a rigid type variable bound by
-        a pattern with constructor:
-          AnApplication :: forall (as :: [*]) b.
-                           AST (ListVariadic as b) -> ASTs as -> AnApplication b,
-        in a case alternative
-        at T16512a.hs:40:9-26
+      ‘b’ is a rigid type variable bound by
+        the type signature for:
+          unapply :: forall b. AST b -> AnApplication b
+        at T16512a.hs:37:1-35
     • In the first argument of ‘AnApplication’, namely ‘g’
       In the expression: AnApplication g (a `ConsAST` as)
       In a case alternative:
           AnApplication g as -> AnApplication g (a `ConsAST` as)
     • Relevant bindings include
-        as :: ASTs as (bound at T16512a.hs:40:25)
         g :: AST (ListVariadic as (a -> b)) (bound at T16512a.hs:40:23)
         a :: AST a (bound at T16512a.hs:38:15)
         f :: AST (a -> b) (bound at T16512a.hs:38:10)
+        unapply :: AST b -> AnApplication b (bound at T16512a.hs:38:1)


=====================================
testsuite/tests/typecheck/should_fail/T7869.stderr
=====================================
@@ -1,18 +1,16 @@
 
 T7869.hs:3:12: error: [GHC-25897]
-    • Couldn't match type ‘a1’ with ‘a’
+    • Couldn't match type ‘b1’ with ‘b’
       Expected: [a1] -> b1
         Actual: [a] -> b
-      ‘a1’ is a rigid type variable bound by
+      ‘b1’ is a rigid type variable bound by
         an expression type signature:
           forall a1 b1. [a1] -> b1
         at T7869.hs:3:20-27
-      ‘a’ is a rigid type variable bound by
+      ‘b’ is a rigid type variable bound by
         the inferred type of f :: [a] -> b
         at T7869.hs:3:1-27
     • In the expression: f x
       In the expression: (\ x -> f x) :: [a] -> b
       In an equation for ‘f’: f = (\ x -> f x) :: [a] -> b
-    • Relevant bindings include
-        x :: [a1] (bound at T7869.hs:3:7)
-        f :: [a] -> b (bound at T7869.hs:3:1)
+    • Relevant bindings include f :: [a] -> b (bound at T7869.hs:3:1)



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/440df186631c058618eb46b4d2e36540e5b7291c
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/20230315/3721ad1c/attachment-0001.html>


More information about the ghc-commits mailing list