Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

29 changed files:

Changes:

  • compiler/GHC/Core/DataCon.hs
    ... ... @@ -30,7 +30,7 @@ module GHC.Core.DataCon (
    30 30
             dataConRepType, dataConInstSig, dataConFullSig,
    
    31 31
             dataConName, dataConIdentity, dataConTag, dataConTagZ,
    
    32 32
             dataConTyCon, dataConOrigTyCon,
    
    33
    -        dataConWrapperType, dataConNonlinearType,
    
    33
    +        dataConWrapperType,
    
    34 34
             dataConUnivTyVars, dataConExTyCoVars, dataConUnivAndExTyCoVars,
    
    35 35
             dataConConcreteTyVars,
    
    36 36
             dataConUserTyVars, dataConUserTyVarBinders,
    
    ... ... @@ -1568,23 +1568,6 @@ dataConWrapperType (MkData { dcUserTyVarBinders = user_tvbs,
    1568 1568
         mkScaledFunTys arg_tys $
    
    1569 1569
         res_ty
    
    1570 1570
     
    
    1571
    -dataConNonlinearType :: DataCon -> Type
    
    1572
    --- ^ Just like 'dataConWrapperType', but with the
    
    1573
    --- linearity on the arguments all zapped to Many.
    
    1574
    ---
    
    1575
    --- Only used temporarily as a stop-gap for hole fit suggestions
    
    1576
    --- until #26338 is fixed.
    
    1577
    -dataConNonlinearType (MkData { dcUserTyVarBinders = user_tvbs,
    
    1578
    -                               dcOtherTheta = theta, dcOrigArgTys = arg_tys,
    
    1579
    -                               dcOrigResTy = res_ty,
    
    1580
    -                               dcStupidTheta = stupid_theta })
    
    1581
    -  = mkForAllTys user_tvbs $
    
    1582
    -    mkInvisFunTys (stupid_theta ++ theta) $
    
    1583
    -    mkScaledFunTys arg_tys' $
    
    1584
    -    res_ty
    
    1585
    -  where
    
    1586
    -    arg_tys' = map (\(Scaled w t) -> Scaled (case w of OneTy -> ManyTy; _ -> w) t) arg_tys
    
    1587
    -
    
    1588 1571
     -- | Finds the instantiated types of the arguments required to construct a
    
    1589 1572
     -- 'DataCon' representation
    
    1590 1573
     -- NB: these INCLUDE any dictionary args
    

  • compiler/GHC/Tc/Errors/Hole.hs
    ... ... @@ -36,13 +36,16 @@ import GHC.Tc.Utils.Monad
    36 36
     import GHC.Tc.Types.Constraint
    
    37 37
     import GHC.Tc.Types.Origin
    
    38 38
     import GHC.Tc.Utils.TcMType
    
    39
    +import GHC.Tc.TyCl.PatSyn (patSynBuilderOcc)
    
    39 40
     import GHC.Tc.Types.Evidence
    
    40 41
     import GHC.Tc.Types.CtLoc
    
    41 42
     import GHC.Tc.Utils.TcType
    
    42 43
     import GHC.Tc.Zonk.TcType
    
    43 44
     import GHC.Core.TyCon( TyCon, isGenerativeTyCon )
    
    44 45
     import GHC.Core.TyCo.Rep( Type(..) )
    
    46
    +import GHC.Core.Type (funTyFlagTyCon)
    
    45 47
     import GHC.Core.DataCon
    
    48
    +import GHC.Core.PatSyn (patSynName)
    
    46 49
     import GHC.Core.Predicate( Pred(..), classifyPredType, eqRelRole )
    
    47 50
     import GHC.Types.Basic
    
    48 51
     import GHC.Types.Name
    
    ... ... @@ -50,6 +53,8 @@ import GHC.Types.Name.Reader
    50 53
     import GHC.Builtin.Names ( gHC_INTERNAL_ERR, gHC_INTERNAL_UNSAFE_COERCE )
    
    51 54
     import GHC.Builtin.Types ( tupleDataConName, unboxedSumDataConName )
    
    52 55
     import GHC.Types.Id
    
    56
    +import GHC.Types.Name.Set (extendNameSet, NameSet, emptyNameSet)
    
    57
    +import GHC.Types.Var (isVisibleFunArg)
    
    53 58
     import GHC.Types.Var.Set
    
    54 59
     import GHC.Types.Var.Env
    
    55 60
     import GHC.Types.TyThing
    
    ... ... @@ -71,7 +76,10 @@ import Data.Graph ( graphFromEdges, topSort )
    71 76
     
    
    72 77
     import GHC.Tc.Solver    ( simplifyTopWanteds )
    
    73 78
     import GHC.Tc.Solver.Monad ( runTcSEarlyAbort )
    
    74
    -import GHC.Tc.Utils.Unify ( tcSubTypeSigma )
    
    79
    +import GHC.Tc.Utils.Unify
    
    80
    +  ( DeepSubsumptionFlag(..), DeepSubsumptionDepth(..)
    
    81
    +  , tcSubTypeHoleFit
    
    82
    +  )
    
    75 83
     
    
    76 84
     import GHC.HsToCore.Docs ( extractDocs )
    
    77 85
     import GHC.Hs.Doc
    
    ... ... @@ -91,7 +99,6 @@ import GHC.Data.EnumSet (EnumSet)
    91 99
     import qualified GHC.Data.EnumSet as EnumSet
    
    92 100
     import qualified GHC.LanguageExtensions as LangExt
    
    93 101
     
    
    94
    -
    
    95 102
     {-
    
    96 103
     Note [Valid hole fits include ...]
    
    97 104
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    ... ... @@ -245,6 +252,23 @@ In addition, we call withoutUnification to reset any unified metavariables; this
    245 252
     call is actually done outside tcCheckHoleFit so that the results can be formatted
    
    246 253
     for the user before resetting variables.
    
    247 254
     
    
    255
    +Note [Deep subsumption in tcCheckHoleFit]
    
    256
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    257
    +To check that a candidate fits in a hole, we perform a subsumption check, as
    
    258
    +detailed in Note [Checking hole fits]. However, should we also perform deep
    
    259
    +subsumption? Well, certainly if the user has enabled deep subsumption, and also
    
    260
    +in cases where deep subsumption is required such as to perform eta-expansion
    
    261
    +of data constructors, e.g.
    
    262
    +
    
    263
    +  data T = MkT Int Bool -- so that MkT :: Int %1 -> Bool %1 -> T
    
    264
    +
    
    265
    +  foo :: Int %1 -> Bool -> T
    
    266
    +  foo = _
    
    267
    +
    
    268
    +We should suggest MkT as a valid hole fit, because deep subsumption will
    
    269
    +eta expand to make the multiplicities line up, as per
    
    270
    +Note [Typechecking data constructors] in GHC.Tc.Gen.Head.
    
    271
    +
    
    248 272
     Note [Valid refinement hole fits include ...]
    
    249 273
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    250 274
     When the `-frefinement-level-hole-fits=N` flag is given, we additionally look
    
    ... ... @@ -405,24 +429,61 @@ is discarded.
    405 429
     
    
    406 430
     Note [Speeding up valid hole-fits]
    
    407 431
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    408
    -To fix #16875 we noted that a lot of time was being spent on unnecessary work.
    
    409
    -
    
    410
    -When we'd call `tcCheckHoleFit hole hole_ty ty`, we would end up by generating
    
    411
    -a constraint to show that `hole_ty ~ ty`, including any constraints in `ty`. For
    
    412
    -example, if `hole_ty = Int` and `ty = Foldable t => (a -> Bool) -> t a -> Bool`,
    
    413
    -we'd have `(a_a1pa[sk:1] -> Bool) -> t_t2jk[sk:1] a_a1pa[sk:1] -> Bool ~# Int`
    
    414
    -from the coercion, as well as `Foldable t_t2jk[sk:1]`. By adding a flag to
    
    415
    -`TcSEnv` and adding a `runTcSEarlyAbort`, we can fail as soon as we hit
    
    416
    -an insoluble constraint. Since we don't need the result in the case that it
    
    417
    -fails, a boolean `False` (i.e. "it didn't work" from `runTcSEarlyAbort`)
    
    418
    -is sufficient.
    
    419
    -
    
    420
    -We also check whether the type of the hole is an immutable type variable (i.e.
    
    421
    -a skolem). In that case, the only possible fits are fits of exactly that type,
    
    422
    -which can only come from the locals. This speeds things up quite a bit when we
    
    423
    -don't know anything about the type of the hole. This also helps with degenerate
    
    424
    -fits like (`id (_ :: a)` and `head (_ :: [a])`) when looking for fits of type
    
    425
    -`a`, where `a` is a skolem.
    
    432
    +When computing valid hole fits, we want to quickly rule out identifiers that
    
    433
    +clearly don't fit the type of the hole, without doing too much work.
    
    434
    +This is important for the performance of the "valid hole fits" feature,
    
    435
    +which is known to be slow in some cases (#16875).
    
    436
    +
    
    437
    +The valid hole fits machinery is given the type of the hole and a possible
    
    438
    +candidate identifier, and it computes whether the identifier can be used by
    
    439
    +performing a subtype check
    
    440
    +
    
    441
    +  tcSubTypeHoleFit .. cand_ty hole_ty
    
    442
    +
    
    443
    +which checks that the type of the candidate identifier is more general than
    
    444
    +the type of the hole.
    
    445
    +
    
    446
    +We currently use the following shortcuts.
    
    447
    +
    
    448
    +  1. When computing a set of candidate identifiers for a hole:
    
    449
    +
    
    450
    +    (FastHoles1)
    
    451
    +      If 'hole_ty' is an immutable type variable (i.e. a skolem type variable),
    
    452
    +      then the only possible (useful) fits are fits of exactly that type, which
    
    453
    +      can only come from locally bound variables for which that skolem is in scope.
    
    454
    +      In that case, only include local identifiers in the list of candidate Ids.
    
    455
    +
    
    456
    +      This speeds things up quite a bit when we don't know anything about the type
    
    457
    +      of the hole, and helps with degenerate fits like (`id (_ :: a)` and `head (_ :: [a])`)
    
    458
    +      when looking for fits of type `a`, where `a` is a skolem.
    
    459
    +
    
    460
    +  2. When checking whether a particular candidate 'cand_ty :: cand_ty' fits 'hole_ty':
    
    461
    +
    
    462
    +    (FastHoles2)
    
    463
    +      Abort early if 'cand_ty' is obviously not a subtype of 'hole_ty',
    
    464
    +      according to a cheap test. The current cheap test is in 'definitelyNotSubType',
    
    465
    +      which detects the following cases:
    
    466
    +
    
    467
    +        1. 'cand_ty' and 'hole_ty' have a different TyCon at the head, after
    
    468
    +           looking through foralls and (=>) arrows, e.g.:
    
    469
    +              hole_ty = Int     -- headed by Int
    
    470
    +              cand_ty = Maybe a -- headed by Maybe
    
    471
    +           or
    
    472
    +              hole_ty = forall a b. a -> b               -- headed by (->)
    
    473
    +              cand_ty = forall x y. Num x => Either x y  -- headed by Either
    
    474
    +        2. 'hole_ty' is polymorphic but 'cand_ty' has no polymorphism, e.g.
    
    475
    +              hole_ty = forall a. a -> a
    
    476
    +              cand_ty = Int -> Int
    
    477
    +
    
    478
    +    (FastHoles3)
    
    479
    +      After calling 'tcSubTypeHoleFit' but before running the solver on the
    
    480
    +      constraints that it generated, do a quick check to see if any constraint
    
    481
    +      is obviously insoluble. See Note [tcCheckHoleFit: fast insolubility check].
    
    482
    +
    
    483
    +    (FastHoles4)
    
    484
    +      When running the solver on the constraints generated by 'tcSubTypeHoleFit',
    
    485
    +      do it in a special mode that stops immediately as soon as it spots an
    
    486
    +      insoluble constraint, using 'runTcSEarlyAbort'.
    
    426 487
     -}
    
    427 488
     
    
    428 489
     -- We read the various -no-show-*-of-hole-fits flags
    
    ... ... @@ -517,8 +578,6 @@ getLocalBindings tidy_orig ct_loc
    517 578
             discard_it = go env sofar tc_bndrs
    
    518 579
             keep_it id = go env (id:sofar) tc_bndrs
    
    519 580
     
    
    520
    -
    
    521
    -
    
    522 581
     -- See Note [Valid hole fits include ...]
    
    523 582
     findValidHoleFits :: TidyEnv        -- ^ The tidy_env for zonking
    
    524 583
                       -> [Implication]  -- ^ Enclosing implications for givens
    
    ... ... @@ -558,8 +617,10 @@ findValidHoleFits tidy_env implics simples h@(Hole { hole_sort = ExprHole _
    558 617
                           map IdHFCand lclBinds ++ map GreHFCand lcl
    
    559 618
                globals = map GreHFCand gbl
    
    560 619
                syntax = map NameHFCand (builtIns exts)
    
    561
    -           -- If the hole is a rigid type-variable, then we only check the
    
    620
    +
    
    621
    +           -- If the hole is a rigid type variable, then we only check the
    
    562 622
                -- locals, since only they can match the type (in a meaningful way).
    
    623
    +           -- See (FastHoles1) in Note [Speeding up valid hole-fits].
    
    563 624
                only_locals = any isImmutableTyVar $ getTyVar_maybe hole_ty
    
    564 625
                to_check = if only_locals then locals
    
    565 626
                           else locals ++ syntax ++ globals
    
    ... ... @@ -679,7 +740,6 @@ findValidHoleFits tidy_env implics simples h@(Hole { hole_sort = ExprHole _
    679 740
         possiblyDiscard (Just max) fits = (fits `lengthExceeds` max, take max fits)
    
    680 741
         possiblyDiscard Nothing fits = (False, fits)
    
    681 742
     
    
    682
    -
    
    683 743
     -- We don't (as of yet) handle holes in types, only in expressions.
    
    684 744
     findValidHoleFits env _ _ _ = return (env, noValidHoleFits)
    
    685 745
     
    
    ... ... @@ -732,13 +792,14 @@ sortHoleFitsBySize = return . sortOn sizeOfFit
    732 792
     -- '-fno-sort-valid-hole-fits'.
    
    733 793
     sortHoleFitsByGraph :: [TcHoleFit] -> TcM [TcHoleFit]
    
    734 794
     sortHoleFitsByGraph fits = go [] fits
    
    735
    -  where tcSubsumesWCloning :: TcType -> TcType -> TcM Bool
    
    736
    -        tcSubsumesWCloning ht ty = withoutUnification fvs (tcSubsumes ht ty)
    
    737
    -          where fvs = tyCoFVsOfTypes [ht,ty]
    
    795
    +  where tcSubsumesWCloning :: TcSigmaType -> TcSigmaType -> TcM Bool
    
    796
    +        tcSubsumesWCloning fit_ty cand_ty =
    
    797
    +          withoutUnification (tyCoFVsOfTypes [fit_ty, cand_ty]) $
    
    798
    +            tcSubsumes fit_ty cand_ty
    
    738 799
             go :: [(TcHoleFit, [TcHoleFit])] -> [TcHoleFit] -> TcM [TcHoleFit]
    
    739 800
             go sofar [] = do { traceTc "subsumptionGraph was" $ ppr sofar
    
    740 801
                              ; return $ uncurry (++) $ partition hfIsLcl topSorted }
    
    741
    -          where toV (hf, adjs) = (hf, hfId hf, map hfId adjs)
    
    802
    +          where toV (hf, adjs) = (hf, hfName hf, map hfName adjs)
    
    742 803
                     (graph, fromV, _) = graphFromEdges $ map toV sofar
    
    743 804
                     topSorted = map ((\(h,_,_) -> h) . fromV) $ topSort graph
    
    744 805
             go sofar (hf:hfs) =
    
    ... ... @@ -763,7 +824,7 @@ tcFilterHoleFits :: Maybe Int
    763 824
     tcFilterHoleFits (Just 0) _ _ _ = return (False, []) -- Stop right away on 0
    
    764 825
     tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
    
    765 826
       do { traceTc "checkingFitsFor {" $ ppr hole_ty
    
    766
    -     ; (discards, subs) <- go [] emptyVarSet limit ht candidates
    
    827
    +     ; (discards, subs) <- go [] emptyNameSet limit ht candidates
    
    767 828
          ; traceTc "checkingFitsFor }" empty
    
    768 829
          ; return (discards, subs) }
    
    769 830
       where
    
    ... ... @@ -772,8 +833,8 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
    772 833
         -- Kickoff the checking of the elements.
    
    773 834
         -- We iterate over the elements, checking each one in turn for whether
    
    774 835
         -- it fits, and adding it to the results if it does.
    
    775
    -    go :: [TcHoleFit]           -- What we've found so far.
    
    776
    -       -> VarSet              -- Ids we've already checked
    
    836
    +    go :: [TcHoleFit]         -- What we've found so far.
    
    837
    +       -> NameSet             -- Names of identifiers we have already checked
    
    777 838
            -> Maybe Int           -- How many we're allowed to find, if limited
    
    778 839
            -> (TcType, [TcTyVar]) -- The type, and its refinement variables.
    
    779 840
            -> [HoleFitCandidate]  -- The elements we've yet to check.
    
    ... ... @@ -786,40 +847,59 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
    786 847
             do { traceTc "lookingUp" $ ppr el
    
    787 848
                ; maybeThing <- lookup el
    
    788 849
                ; case maybeThing of
    
    789
    -               Just (id, id_ty) | not_trivial id ->
    
    790
    -                       do { fits <- fitsHole ty id_ty
    
    850
    +               Just cand@(_, is_dc, cand_ty) ->
    
    851
    +                       do { fits <- fitsHole ty cand_ty is_dc
    
    791 852
                               ; case fits of
    
    792
    -                              Just (wrp, matches) -> keep_it id id_ty wrp matches
    
    853
    +                              Just (wrp, matches) -> keep_it cand wrp matches
    
    793 854
                                   _ -> discard_it }
    
    794 855
                    _ -> discard_it }
    
    795 856
             where
    
    796
    -          -- We want to filter out undefined and the likes from GHC.Err (#17940)
    
    797
    -          not_trivial id = nameModule_maybe (idName id) `notElem` [Just gHC_INTERNAL_ERR, Just gHC_INTERNAL_UNSAFE_COERCE]
    
    798
    -
    
    799
    -          lookup :: HoleFitCandidate -> TcM (Maybe (Id, Type))
    
    800
    -          lookup (IdHFCand id) = return (Just (id, idType id))
    
    801
    -          lookup hfc = do { thing <- tcLookup name
    
    802
    -                          ; return $ case thing of
    
    803
    -                                       ATcId {tct_id = id} -> Just (id, idType id)
    
    804
    -                                       AGlobal (AnId id)   -> Just (id, idType id)
    
    805
    -                                       AGlobal (AConLike (RealDataCon con)) ->
    
    806
    -                                           Just (dataConWrapId con, dataConNonlinearType con)
    
    807
    -                                       _ -> Nothing }
    
    808
    -            where name = case hfc of
    
    809
    -                           GreHFCand gre   -> greName gre
    
    810
    -                           NameHFCand name -> name
    
    857
    +          mk_id i
    
    858
    +            -- Filter out undefined and the likes from GHC.Err (#17940).
    
    859
    +            --
    
    860
    +            -- TODO: we might want to filter out more, e.g. if the user defines
    
    861
    +            --
    
    862
    +            --   todo :: forall a. a
    
    863
    +            --   todo = undefined
    
    864
    +            --
    
    865
    +            -- we probably don't want to suggest 'todo' as a hole fit either.
    
    866
    +            | let nm = idName i
    
    867
    +            , nameModule_maybe nm `notElem` [Just gHC_INTERNAL_ERR, Just gHC_INTERNAL_UNSAFE_COERCE]
    
    868
    +            = Just (nm, False, idType i)
    
    869
    +            | otherwise
    
    870
    +            = Nothing
    
    871
    +
    
    872
    +          lookup :: HoleFitCandidate -> TcM (Maybe (Name, Bool, Type))
    
    873
    +          lookup (IdHFCand id) = return $ mk_id id
    
    874
    +          lookup hfc =
    
    875
    +            do { thing <- tcLookup name
    
    876
    +               ; return $
    
    877
    +                   case thing of
    
    878
    +                     ATcId {tct_id = id} -> mk_id id
    
    879
    +                     AGlobal (AnId id)   -> mk_id id
    
    880
    +                     AGlobal (AConLike (RealDataCon con)) ->
    
    881
    +                         Just (dataConName con, True, dataConWrapperType con)
    
    882
    +                     AGlobal (AConLike (PatSynCon ps))
    
    883
    +                       | Just (_,t) <- patSynBuilderOcc ps
    
    884
    +                       -> -- If we ever get a 'Todo' pattern synonym,
    
    885
    +                          -- we should filter it out here.
    
    886
    +                         Just (patSynName ps, False, t)
    
    887
    +                     _ -> Nothing }
    
    888
    +
    
    889
    +            where
    
    890
    +              name = case hfc of
    
    891
    +                        GreHFCand gre   -> greName gre
    
    892
    +                        NameHFCand name -> name
    
    893
    +
    
    811 894
               discard_it = go subs seen maxleft ty elts
    
    812
    -          keep_it eid eid_ty wrp ms = go (fit:subs) (extendVarSet seen eid)
    
    895
    +          keep_it (enm, _, ety) wrp ms = go (fit:subs) (extendNameSet seen enm)
    
    813 896
                                      ((\n -> n - 1) <$> maxleft) ty elts
    
    814 897
                 where
    
    815
    -              fit = HoleFit { hfId = eid, hfCand = el, hfType = eid_ty
    
    898
    +              fit = HoleFit { hfName = enm, hfCand = el, hfType = ety
    
    816 899
                                 , hfRefLvl = length (snd ty)
    
    817 900
                                 , hfWrap = wrp, hfMatches = ms
    
    818 901
                                 , hfDoc = Nothing }
    
    819 902
     
    
    820
    -
    
    821
    -
    
    822
    -
    
    823 903
         unfoldWrapper :: HsWrapper -> [Type]
    
    824 904
         unfoldWrapper = reverse . unfWrp'
    
    825 905
           where
    
    ... ... @@ -828,7 +908,6 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
    828 908
             unfWrp' (WpCompose w1 w2) = unfWrp' w1 ++ unfWrp' w2
    
    829 909
             unfWrp' _                  = []
    
    830 910
     
    
    831
    -
    
    832 911
         -- The real work happens here, where we invoke the type checker using
    
    833 912
         -- tcCheckHoleFit to see whether the given type fits the hole.
    
    834 913
         fitsHole :: (TcType, [TcTyVar]) -- The type of the hole wrapped with the
    
    ... ... @@ -845,27 +924,36 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
    845 924
                                         -- In the base case with no additional
    
    846 925
                                         -- holes, h_ty will just be t and ref_vars
    
    847 926
                                         -- will be [].
    
    848
    -             -> TcType -- The type we're checking to whether it can be
    
    849
    -                       -- instantiated to the type h_ty.
    
    927
    +             -> TcType -- The type of the hole fit candidate
    
    928
    +             -> Bool   -- Is the hole fit candidate a data constructor?
    
    850 929
                  -> TcM (Maybe ([TcType], [TcType])) -- If it is not a match, we
    
    851 930
                                                      -- return Nothing. Otherwise,
    
    852 931
                                                      -- we Just return the list of
    
    853 932
                                                      -- types that quantified type
    
    854
    -                                                 -- variables in ty would take
    
    933
    +                                                 -- variables in cand_ty would take
    
    855 934
                                                      -- if used in place of h_ty,
    
    856 935
                                                      -- and the list types of any
    
    857 936
                                                      -- additional holes simulated
    
    858 937
                                                      -- with the refinement
    
    859 938
                                                      -- variables in ref_vars.
    
    860
    -    fitsHole (h_ty, ref_vars) ty =
    
    939
    +    fitsHole (h_ty, ref_vars) cand_ty cand_is_datacon =
    
    861 940
         -- We wrap this with the withoutUnification to avoid having side-effects
    
    862 941
         -- beyond the check, but we rely on the side-effects when looking for
    
    863 942
         -- refinement hole fits, so we can't wrap the side-effects deeper than this.
    
    864 943
           withoutUnification fvs $
    
    865
    -      do { traceTc "checkingFitOf {" $ ppr ty
    
    866
    -         ; (fits, wrp) <- tcCheckHoleFit hole h_ty ty
    
    867
    -         ; traceTc "Did it fit?" $ ppr fits
    
    868
    -         ; traceTc "wrap is: " $ ppr wrp
    
    944
    +      do { traceTc "checkingFitOf {" $ ppr cand_ty
    
    945
    +
    
    946
    +           -- Compute 'ds_flag' with the same logic as 'getDeepSubsumptionFlag_DataConHead'.
    
    947
    +         ; user_ds <- xoptM LangExt.DeepSubsumption
    
    948
    +         ; let ds_flag
    
    949
    +                 | user_ds
    
    950
    +                 = Deep DeepSub
    
    951
    +                 | cand_is_datacon
    
    952
    +                 = Deep TopSub
    
    953
    +                 | otherwise
    
    954
    +                 = Shallow
    
    955
    +         ; mbWrap <- tcCheckHoleFit ds_flag hole h_ty cand_ty
    
    956
    +         ; traceTc "Did it fit?" $ ppr mbWrap
    
    869 957
              ; traceTc "checkingFitOf }" empty
    
    870 958
              -- We'd like to avoid refinement suggestions like `id _ _` or
    
    871 959
              -- `head _ _`, and only suggest refinements where our all phantom
    
    ... ... @@ -875,7 +963,8 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
    875 963
              -- variables, i.e. zonk them to read their final value to check for
    
    876 964
              -- abstract refinements, and to report what the type of the simulated
    
    877 965
              -- holes must be for this to be a match.
    
    878
    -         ; if fits then do {
    
    966
    +         ; case mbWrap of
    
    967
    +            { Just wrp -> do {
    
    879 968
                   -- Zonking is expensive, so we only do it if required.
    
    880 969
                   z_wrp_tys <- liftZonkM $ zonkTcTypes (unfoldWrapper wrp)
    
    881 970
                 ; if null ref_vars
    
    ... ... @@ -895,12 +984,10 @@ tcFilterHoleFits limit typed_hole ht@(hole_ty, _) candidates =
    895 984
                           ; if allowAbstract || (allFilled && allConcrete )
    
    896 985
                             then return $ Just (z_wrp_tys, z_vars)
    
    897 986
                             else return Nothing }}
    
    898
    -           else return Nothing }
    
    899
    -     where fvs = mkFVs ref_vars `unionFV` hole_fvs `unionFV` tyCoFVsOfType ty
    
    987
    +           ; Nothing -> return Nothing } }
    
    988
    +     where fvs = mkFVs ref_vars `unionFV` hole_fvs `unionFV` tyCoFVsOfType cand_ty
    
    900 989
                hole = typed_hole { th_hole = Nothing }
    
    901 990
     
    
    902
    -
    
    903
    -
    
    904 991
     -- | Checks whether a MetaTyVar is flexible or not.
    
    905 992
     isFlexiTyVar :: TcTyVar -> TcM Bool
    
    906 993
     isFlexiTyVar tv | isMetaTyVar tv = isFlexi <$> readMetaTyVar tv
    
    ... ... @@ -923,7 +1010,7 @@ withoutUnification free_vars action =
    923 1010
     -- discarding any errors. Subsumption here means that the ty_b can fit into the
    
    924 1011
     -- ty_a, i.e. `tcSubsumes a b == True` if b is a subtype of a.
    
    925 1012
     tcSubsumes :: TcSigmaType -> TcSigmaType -> TcM Bool
    
    926
    -tcSubsumes ty_a ty_b = fst <$> tcCheckHoleFit dummyHole ty_a ty_b
    
    1013
    +tcSubsumes ty_a ty_b = isJust <$> tcCheckHoleFit Shallow dummyHole ty_a ty_b
    
    927 1014
       where dummyHole = TypedHole { th_relevant_cts = emptyBag
    
    928 1015
                                   , th_implics      = []
    
    929 1016
                                   , th_hole         = Nothing }
    
    ... ... @@ -932,16 +1019,22 @@ tcSubsumes ty_a ty_b = fst <$> tcCheckHoleFit dummyHole ty_a ty_b
    932 1019
     -- #14273. This makes sure that when checking whether a type fits the hole,
    
    933 1020
     -- the type has to be subsumed by type of the hole as well as fulfill all
    
    934 1021
     -- constraints on the type of the hole.
    
    935
    -tcCheckHoleFit :: TypedHole   -- ^ The hole to check against
    
    1022
    +tcCheckHoleFit :: DeepSubsumptionFlag
    
    1023
    +               -> TypedHole   -- ^ The hole to check against
    
    936 1024
                    -> TcSigmaType
    
    937 1025
                    -- ^ The type of the hole to check against (possibly modified,
    
    938 1026
                    -- e.g. refined with additional holes for refinement hole-fits.)
    
    939
    -               -> TcSigmaType -- ^ The type to check whether fits.
    
    940
    -               -> TcM (Bool, HsWrapper)
    
    941
    -               -- ^ Whether it was a match, and the wrapper from hole_ty to ty.
    
    942
    -tcCheckHoleFit _ hole_ty ty | hole_ty `eqType` ty
    
    943
    -    = return (True, idHsWrapper)
    
    944
    -tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
    
    1027
    +               -> TcSigmaType
    
    1028
    +                 -- ^ The candidate fit type
    
    1029
    +               -> TcM (Maybe HsWrapper)
    
    1030
    +               -- ^ Whether it was a match, and the wrapper from hole_ty to cand_ty
    
    1031
    +tcCheckHoleFit _ _ hole_ty cand_ty
    
    1032
    +  -- (FastHoles2) from Note [Speeding up valid hole-fits]
    
    1033
    +  | definitelyNotSubType cand_ty hole_ty
    
    1034
    +  = return Nothing
    
    1035
    +  | hole_ty `eqType` cand_ty
    
    1036
    +  = return $ Just idHsWrapper
    
    1037
    +tcCheckHoleFit ds_flag (TypedHole {..}) hole_ty cand_ty = discardErrs $
    
    945 1038
       do { -- We wrap the subtype constraint in the implications to pass along the
    
    946 1039
            -- givens, and so we must ensure that any nested implications and skolems
    
    947 1040
            -- end up with the correct level. The implications are ordered so that
    
    ... ... @@ -952,16 +1045,21 @@ tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
    952 1045
                               [] -> getTcLevel
    
    953 1046
                               -- imp is the innermost implication
    
    954 1047
                               (imp:_) -> return (ic_tclvl imp)
    
    955
    -     ; (wrap, wanted) <- setTcLevel innermost_lvl $ captureConstraints $
    
    956
    -                         tcSubTypeSigma orig (ExprSigCtxt NoRRC) ty hole_ty
    
    1048
    +
    
    1049
    +     ; (wrap, wanted) <-
    
    1050
    +         setTcLevel innermost_lvl $ captureConstraints $
    
    1051
    +         tcSubTypeHoleFit ds_flag orig cand_ty hole_ty
    
    1052
    +           -- See Note [Deep subsumption in tcCheckHoleFit]
    
    1053
    +
    
    957 1054
          ; traceTc "Checking hole fit {" empty
    
    958 1055
          ; traceTc "wanteds are: " $ ppr wanted
    
    959 1056
          ; if | isEmptyWC wanted, isEmptyBag th_relevant_cts
    
    960 1057
               -> do { traceTc "}" empty
    
    961
    -                ; return (True, wrap) }
    
    1058
    +                ; return $ Just wrap }
    
    962 1059
     
    
    963
    -          | checkInsoluble wanted -- See Note [Fast path for tcCheckHoleFit]
    
    964
    -          -> return (False, wrap)
    
    1060
    +          -- (FastHoles3) from Note [Speeding up valid hole-fits]
    
    1061
    +          | checkInsoluble wanted
    
    1062
    +          -> return Nothing
    
    965 1063
     
    
    966 1064
               | otherwise
    
    967 1065
               -> do { fresh_binds <- newTcEvBinds
    
    ... ... @@ -979,10 +1077,16 @@ tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
    979 1077
                       -- the wanteds, because they are freshly generated by the
    
    980 1078
                       -- call to`tcSubtype_NC`.
    
    981 1079
                     ; traceTc "final_wc is: " $ ppr final_wc
    
    982
    -                  -- See Note [Speeding up valid hole-fits]
    
    983
    -                ; (rem, _) <- tryTc $ runTcSEarlyAbort $ simplifyTopWanteds final_wc
    
    1080
    +
    
    1081
    +                  -- runTcSEarlyAbort: (FastHoles4) from Note [Speeding up valid hole-fits]
    
    1082
    +                ; (rem, _) <- tryTc $ runTcSEarlyAbort
    
    1083
    +                                    $ simplifyTopWanteds final_wc
    
    984 1084
                     ; traceTc "}" empty
    
    985
    -                ; return (any isSolvedWC rem, wrap) } }
    
    1085
    +                ; return $
    
    1086
    +                    if any isSolvedWC rem
    
    1087
    +                    then Just wrap
    
    1088
    +                    else Nothing
    
    1089
    +                } }
    
    986 1090
       where
    
    987 1091
         orig = ExprHoleOrigin (hole_occ <$> th_hole)
    
    988 1092
     
    
    ... ... @@ -993,15 +1097,15 @@ tcCheckHoleFit (TypedHole {..}) hole_ty ty = discardErrs $
    993 1097
         setWCAndBinds binds imp wc
    
    994 1098
           = mkImplicWC $ unitBag $ imp { ic_wanted = wc , ic_binds = binds }
    
    995 1099
     
    
    996
    -{- Note [Fast path for tcCheckHoleFit]
    
    1100
    +{- Note [tcCheckHoleFit: fast insolubility check]
    
    997 1101
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    998
    -In `tcCheckHoleFit` we compare (with `tcSubTypeSigma`) the type of the hole
    
    1102
    +In `tcCheckHoleFit` we compare (with `tcSubTypeHoleFit`) the type of the hole
    
    999 1103
     with the type of zillions of in-scope functions, to see which would "fit".
    
    1000 1104
     Most of these checks fail!  They generate obviously-insoluble constraints.
    
    1001 1105
     For these very-common cases we don't want to crank up the full constraint
    
    1002 1106
     solver.  It's much more efficient to do a quick-and-dirty check for insolubility.
    
    1003 1107
     
    
    1004
    -Now, `tcSubTypeSigma` uses the on-the-fly unifier in GHC.Tc.Utils.Unify,
    
    1108
    +Now, `tcSubTypeHoleFit` uses the on-the-fly unifier in GHC.Tc.Utils.Unify,
    
    1005 1109
     it has already done the dirt-simple unification. So our quick-and-dirty
    
    1006 1110
     check can simply look for constraints like (Int ~ Bool).  We don't need
    
    1007 1111
     to worry about (Maybe Int ~ Maybe Bool).
    
    ... ... @@ -1010,9 +1114,8 @@ The quick-and-dirty check is in `checkInsoluble`. It can make a big
    1010 1114
     difference: For test hard_hole_fits, compile-time allocation goes down by 37%!
    
    1011 1115
     -}
    
    1012 1116
     
    
    1013
    -
    
    1014 1117
     checkInsoluble :: WantedConstraints -> Bool
    
    1015
    --- See Note [Fast path for tcCheckHoleFit]
    
    1118
    +-- See Note [tcCheckHoleFit: fast insolubility check]
    
    1016 1119
     checkInsoluble (WC { wc_simple = simples })
    
    1017 1120
       = any is_insol simples
    
    1018 1121
       where
    
    ... ... @@ -1021,7 +1124,7 @@ checkInsoluble (WC { wc_simple = simples })
    1021 1124
                         _              -> False
    
    1022 1125
     
    
    1023 1126
     definitelyNotEqual :: Role -> TcType -> TcType -> Bool
    
    1024
    --- See Note [Fast path for tcCheckHoleFit]
    
    1127
    +-- See Note [tcCheckHoleFit: fast insolubility check]
    
    1025 1128
     -- Specifically, does not need to recurse under type constructors
    
    1026 1129
     definitelyNotEqual r t1 t2
    
    1027 1130
       = go t1 t2
    
    ... ... @@ -1041,3 +1144,46 @@ definitelyNotEqual r t1 t2
    1041 1144
         go_tc _ (FunTy {})    = True
    
    1042 1145
         go_tc _ (ForAllTy {}) = True
    
    1043 1146
         go_tc _ _ = False
    
    1147
    +
    
    1148
    +-- | @definitelyNotSubType cand_ty hole_ty@ computes whether @cand_ty@ is
    
    1149
    +-- **definitely not** a subtype of @hole_ty@, in order to quickly rule out
    
    1150
    +-- a possible hole fit candidate without having to do any solving.
    
    1151
    +--
    
    1152
    +-- See (FastHoles2) in Note [Speeding up valid hole-fits].
    
    1153
    +definitelyNotSubType :: TcType -> TcType -> Bool
    
    1154
    +definitelyNotSubType = go
    
    1155
    +  where
    
    1156
    +    go cand_ty hole_ty
    
    1157
    +      -- Expand type synonyms
    
    1158
    +      | Just cand_ty' <- coreView cand_ty
    
    1159
    +      = go cand_ty' hole_ty
    
    1160
    +      | Just hole_ty' <- coreView hole_ty
    
    1161
    +      = go cand_ty hole_ty'
    
    1162
    +
    
    1163
    +      -- Different TyCons at the head (looking through foralls and =>).
    
    1164
    +      | Just tc1 <- tc_head cand_ty
    
    1165
    +      , Just tc2 <- tc_head hole_ty
    
    1166
    +      , tc1 /= tc2
    
    1167
    +      = True
    
    1168
    +
    
    1169
    +      -- Non-forall type does not fit a forall-typed hole.
    
    1170
    +      | isSigmaTy hole_ty
    
    1171
    +      , isTauTy cand_ty
    
    1172
    +      = True
    
    1173
    +
    
    1174
    +      | otherwise
    
    1175
    +      = False
    
    1176
    +
    
    1177
    +    -- Is this Type a TyConApp, after looking under foralls and =>?
    
    1178
    +    -- If so, return the TyCon at the head.
    
    1179
    +    tc_head :: Type -> Maybe TyCon
    
    1180
    +    tc_head (FunTy { ft_af = af, ft_res = res })
    
    1181
    +      | not $ isVisibleFunArg af
    
    1182
    +      = tc_head res
    
    1183
    +      | otherwise
    
    1184
    +      = Just $ funTyFlagTyCon af
    
    1185
    +    tc_head (TyConApp tc _)
    
    1186
    +      = Just tc
    
    1187
    +    tc_head (ForAllTy _ body)
    
    1188
    +      = tc_head body
    
    1189
    +    tc_head _ = Nothing

  • compiler/GHC/Tc/Errors/Hole/FitTypes.hs
    ... ... @@ -19,6 +19,7 @@ import GHC.Types.Name
    19 19
     import GHC.Data.Bag
    
    20 20
     
    
    21 21
     import Data.Function ( on )
    
    22
    +import qualified Data.Semigroup as S
    
    22 23
     
    
    23 24
     data TypedHole = TypedHole { th_relevant_cts :: Bag CtEvidence
    
    24 25
                                -- ^ Any relevant Cts to the hole
    
    ... ... @@ -77,15 +78,15 @@ instance Ord HoleFitCandidate where
    77 78
     -- and the refinement level of the fit, which is the number of extra argument
    
    78 79
     -- holes that this fit uses (e.g. if hfRefLvl is 2, the fit is for `Id _ _`).
    
    79 80
     data TcHoleFit =
    
    80
    -  HoleFit { hfId   :: Id       -- ^ The elements id in the TcM
    
    81
    -          , hfCand :: HoleFitCandidate  -- ^ The candidate that was checked.
    
    82
    -          , hfType :: TcType -- ^ The type of the id, possibly zonked.
    
    83
    -          , hfRefLvl :: Int  -- ^ The number of holes in this fit.
    
    84
    -          , hfWrap :: [TcType] -- ^ The wrapper for the match.
    
    81
    +  HoleFit { hfName :: Name              -- ^ The name of the hole fit identifier
    
    82
    +          , hfCand :: HoleFitCandidate  -- ^ The candidate that was checked
    
    83
    +          , hfType :: TcType -- ^ The type of the hole fit (possibly zonked)
    
    84
    +          , hfRefLvl :: Int  -- ^ The number of holes in this fit
    
    85
    +          , hfWrap :: [TcType] -- ^ The wrapper for the match
    
    85 86
               , hfMatches :: [TcType]
    
    86 87
               -- ^ What the refinement variables got matched with, if anything
    
    87 88
               , hfDoc :: Maybe [HsDocString]
    
    88
    -          -- ^ Documentation of this HoleFit, if available.
    
    89
    +          -- ^ Documentation of this HoleFit, if available
    
    89 90
               }
    
    90 91
     
    
    91 92
     data HoleFit
    
    ... ... @@ -96,30 +97,25 @@ data HoleFit
    96 97
     
    
    97 98
     -- We define an Eq and Ord instance to be able to build a graph.
    
    98 99
     instance Eq TcHoleFit where
    
    99
    -   (==) = (==) `on` hfId
    
    100
    +   (==) = (==) `on` hfName
    
    100 101
     
    
    101 102
     instance Outputable HoleFit where
    
    102 103
       ppr (TcHoleFit hf)  = ppr hf
    
    103 104
       ppr (RawHoleFit sd) = sd
    
    104 105
     
    
    105 106
     instance Outputable TcHoleFit where
    
    106
    -  ppr (HoleFit _ cand ty _ _ mtchs _) =
    
    107
    -    hang (name <+> holes) 2 (text "where" <+> name <+> dcolon <+> (ppr ty))
    
    108
    -    where name = ppr $ getName cand
    
    109
    -          holes = sep $ map (parens . (text "_" <+> dcolon <+>) . ppr) mtchs
    
    110
    -
    
    111
    --- We compare HoleFits by their name instead of their Id, since we don't
    
    112
    --- want our tests to be affected by the non-determinism of `nonDetCmpVar`,
    
    113
    --- which is used to compare Ids. When comparing, we want HoleFits with a lower
    
    114
    --- refinement level to come first.
    
    107
    +  ppr (HoleFit { hfName = cand, hfType = ty, hfMatches = mtchs }) =
    
    108
    +    hang (ppr cand <+> holes) 2 (text "where" <+> ppr cand <+> dcolon <+> (ppr ty))
    
    109
    +    where holes = sep $ map (parens . (text "_" <+> dcolon <+>) . ppr) mtchs
    
    110
    +
    
    111
    +-- | Compare HoleFits by their 'Name'. Use 'stableNameCmp' to avoid non-determinism.
    
    112
    +--
    
    113
    +-- When comparing, we want HoleFits with a lower refinement level to come first.
    
    115 114
     instance Ord TcHoleFit where
    
    116
    ---  compare (RawHoleFit _) (RawHoleFit _) = EQ
    
    117
    ---  compare (RawHoleFit _) _ = LT
    
    118
    ---  compare _ (RawHoleFit _) = GT
    
    119
    -  compare a@(HoleFit {}) b@(HoleFit {}) = cmp a b
    
    120
    -    where cmp  = if hfRefLvl a == hfRefLvl b
    
    121
    -                 then compare `on` (getName . hfCand)
    
    122
    -                 else compare `on` hfRefLvl
    
    115
    +  compare a@(HoleFit {}) b@(HoleFit {}) =
    
    116
    +    compare (hfRefLvl a) (hfRefLvl b)
    
    117
    +      S.<>
    
    118
    +    stableNameCmp (hfName a) (hfName b)
    
    123 119
     
    
    124 120
     hfIsLcl :: TcHoleFit -> Bool
    
    125 121
     hfIsLcl hf@(HoleFit {}) = case hfCand hf of
    

  • compiler/GHC/Tc/Errors/Ppr.hs
    ... ... @@ -3595,7 +3595,7 @@ pprHoleFit :: HoleFitDispConfig -> HoleFit -> SDoc
    3595 3595
     pprHoleFit _ (RawHoleFit sd) = sd
    
    3596 3596
     pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
    
    3597 3597
      hang display 2 provenance
    
    3598
    - where tyApp = sep $ zipWithEqual pprArg vars hfWrap
    
    3598
    + where tyApp = sep $ zipWith pprArg vars hfWrap
    
    3599 3599
              where pprArg b arg = case binderFlag b of
    
    3600 3600
                                     Specified -> text "@" <> pprParendType arg
    
    3601 3601
                                       -- Do not print type application for inferred
    
    ... ... @@ -3604,20 +3604,9 @@ pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
    3604 3604
                                     Required  -> pprPanic "pprHoleFit: bad Required"
    
    3605 3605
                                                              (ppr b <+> ppr arg)
    
    3606 3606
            tyAppVars = sep $ punctuate comma $
    
    3607
    -           zipWithEqual (\v t -> ppr (binderVar v) <+> text "~" <+> pprParendType t)
    
    3607
    +           zipWith (\v t -> ppr (binderVar v) <+> text "~" <+> pprParendType t)
    
    3608 3608
                vars hfWrap
    
    3609
    -
    
    3610
    -       vars = unwrapTypeVars hfType
    
    3611
    -         where
    
    3612
    -           -- Attempts to get all the quantified type variables in a type,
    
    3613
    -           -- e.g.
    
    3614
    -           -- return :: forall (m :: * -> *) Monad m => (forall a . a -> m a)
    
    3615
    -           -- into [m, a]
    
    3616
    -           unwrapTypeVars :: Type -> [ForAllTyBinder]
    
    3617
    -           unwrapTypeVars t = vars ++ case splitFunTy_maybe unforalled of
    
    3618
    -                               Just (_, _, _, unfunned) -> unwrapTypeVars unfunned
    
    3619
    -                               _ -> []
    
    3620
    -             where (vars, unforalled) = splitForAllForAllTyBinders t
    
    3609
    +       vars = deepInvisTvBinders hfType
    
    3621 3610
            holeVs = sep $ map (parens . (text "_" <+> dcolon <+>) . ppr) hfMatches
    
    3622 3611
            holeDisp = if sMs then holeVs
    
    3623 3612
                       else sep $ replicate (length hfMatches) $ text "_"
    
    ... ... @@ -3644,6 +3633,18 @@ pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
    3644 3633
                      NameHFCand name -> text "bound at" <+> ppr (getSrcLoc name)
    
    3645 3634
                      IdHFCand id_ -> text "bound at" <+> ppr (getSrcLoc id_)
    
    3646 3635
     
    
    3636
    +-- | Similar to 'tcDeepSplitSigmaTy_maybe', but just cares about the binders.
    
    3637
    +deepInvisTvBinders :: TcSigmaType -> [ForAllTyBinder]
    
    3638
    +deepInvisTvBinders = go
    
    3639
    +  where
    
    3640
    +    go ty | Just (_arg_ty, res_ty) <- tcSplitFunTy_maybe ty
    
    3641
    +          = go res_ty
    
    3642
    +          | (tvs, body) <- splitForAllForAllTyBinders ty
    
    3643
    +          , not (null tvs)
    
    3644
    +          = tvs ++ go body
    
    3645
    +          | otherwise
    
    3646
    +          = []
    
    3647
    +
    
    3647 3648
     -- | Add a "Constraints include..." message.
    
    3648 3649
     --
    
    3649 3650
     -- See Note [Constraints include ...]
    

  • compiler/GHC/Tc/Gen/App.hs
    ... ... @@ -420,20 +420,6 @@ quickLookResultType :: TcRhoType -> ExpRhoType -> TcM ()
    420 420
     quickLookResultType app_res_rho (Check exp_rho) = qlUnify app_res_rho exp_rho
    
    421 421
     quickLookResultType _           _               = return ()
    
    422 422
     
    
    423
    --- | Variant of 'getDeepSubsumptionFlag' which enables a top-level subsumption
    
    424
    --- in order to implement the plan of Note [Typechecking data constructors].
    
    425
    -getDeepSubsumptionFlag_DataConHead :: HsExpr GhcTc -> TcM DeepSubsumptionFlag
    
    426
    -getDeepSubsumptionFlag_DataConHead app_head =
    
    427
    -  do { user_ds <- xoptM LangExt.DeepSubsumption
    
    428
    -     ; return $
    
    429
    -         if | user_ds
    
    430
    -            -> Deep DeepSub
    
    431
    -            | XExpr (ConLikeTc (RealDataCon {})) <- app_head
    
    432
    -            -> Deep TopSub
    
    433
    -            | otherwise
    
    434
    -            -> Shallow
    
    435
    -    }
    
    436
    -
    
    437 423
     finishApp :: (HsExpr GhcTc, AppCtxt) -> [HsExprArg 'TcpTc]
    
    438 424
               -> TcRhoType -> HsWrapper
    
    439 425
               -> TcM (HsExpr GhcTc)
    

  • compiler/GHC/Tc/Utils/Unify.hs
    ... ... @@ -11,7 +11,7 @@
    11 11
     module GHC.Tc.Utils.Unify (
    
    12 12
       -- Full-blown subsumption
    
    13 13
       tcWrapResult, tcWrapResultO, tcWrapResultMono,
    
    14
    -  tcSubType, tcSubTypeSigma, tcSubTypePat, tcSubTypeDS,
    
    14
    +  tcSubType, tcSubTypeSigma, tcSubTypePat, tcSubTypeDS, tcSubTypeHoleFit,
    
    15 15
       addSubTypeCtxt,
    
    16 16
       tcSubTypeAmbiguity, tcSubMult,
    
    17 17
       checkConstraints, checkTvConstraints,
    
    ... ... @@ -19,7 +19,7 @@ module GHC.Tc.Utils.Unify (
    19 19
     
    
    20 20
       -- Skolemisation
    
    21 21
       DeepSubsumptionFlag(..), DeepSubsumptionDepth(..),
    
    22
    -  getDeepSubsumptionFlag,
    
    22
    +  getDeepSubsumptionFlag, getDeepSubsumptionFlag_DataConHead,
    
    23 23
       isRhoTyDS,
    
    24 24
       tcSkolemise, tcSkolemiseCompleteSig, tcSkolemiseExpectedType,
    
    25 25
     
    
    ... ... @@ -77,6 +77,7 @@ import GHC.Tc.Utils.TcMType qualified as TcM
    77 77
     
    
    78 78
     import GHC.Tc.Solver.InertSet
    
    79 79
     
    
    80
    +import GHC.Core.ConLike (ConLike(..))
    
    80 81
     import GHC.Core.Type
    
    81 82
     import GHC.Core.TyCo.Rep hiding (Refl)
    
    82 83
     import GHC.Core.TyCo.FVs( isInjectiveInType )
    
    ... ... @@ -1485,6 +1486,16 @@ tcSubTypeSigma :: CtOrigin -- where did the actual type arise / why are we
    1485 1486
     tcSubTypeSigma orig ctxt ty_actual ty_expected
    
    1486 1487
       = tc_sub_type (unifyType Nothing) orig ctxt ty_actual ty_expected
    
    1487 1488
     
    
    1489
    +tcSubTypeHoleFit :: DeepSubsumptionFlag
    
    1490
    +                 -> CtOrigin
    
    1491
    +                 -> TcSigmaType  -- ^ Candidate expression type
    
    1492
    +                 -> TcSigmaType  -- ^ Expected type (= hole type)
    
    1493
    +                 -> TcM HsWrapper
    
    1494
    +tcSubTypeHoleFit ds_flag orig cand_ty hole_ty =
    
    1495
    +   -- See Note [Deep subsumption in tcCheckHoleFit]
    
    1496
    +  tc_sub_type_ds (Nothing, Top) ds_flag (unifyType Nothing)
    
    1497
    +    orig (ExprSigCtxt NoRRC) cand_ty hole_ty
    
    1498
    +
    
    1488 1499
     ---------------
    
    1489 1500
     tcSubTypeAmbiguity :: UserTypeCtxt   -- Where did this type arise
    
    1490 1501
                        -> TcSigmaType -> TcSigmaType -> TcM HsWrapper
    
    ... ... @@ -2015,6 +2026,20 @@ getDeepSubsumptionFlag =
    2015 2026
            else return Shallow
    
    2016 2027
          }
    
    2017 2028
     
    
    2029
    +-- | Variant of 'getDeepSubsumptionFlag' which enables a top-level subsumption
    
    2030
    +-- in order to implement the plan of Note [Typechecking data constructors].
    
    2031
    +getDeepSubsumptionFlag_DataConHead :: HsExpr GhcTc -> TcM DeepSubsumptionFlag
    
    2032
    +getDeepSubsumptionFlag_DataConHead app_head =
    
    2033
    +  do { user_ds <- xoptM LangExt.DeepSubsumption
    
    2034
    +     ; return $
    
    2035
    +         if | user_ds
    
    2036
    +            -> Deep DeepSub
    
    2037
    +            | XExpr (ConLikeTc (RealDataCon {})) <- app_head
    
    2038
    +            -> Deep TopSub
    
    2039
    +            | otherwise
    
    2040
    +            -> Shallow
    
    2041
    +    }
    
    2042
    +
    
    2018 2043
     -- | 'tc_sub_type_deep' is where the actual work happens for deep subsumption.
    
    2019 2044
     --
    
    2020 2045
     -- Given @ty_actual@ (a sigma-type) and @ty_expected@ (deeply skolemised, i.e.
    

  • docs/users_guide/9.16.1-notes.rst
    ... ... @@ -42,6 +42,9 @@ Compiler
    42 42
       bound to variables. The very similar pattern ``Foo{bar = Bar{baz = 42}}``
    
    43 43
       will will not yet mark ``bar`` or ``baz`` as covered.
    
    44 44
     
    
    45
    +- Pattern synonyms can now be suggested as valid hole fits (except, of course,
    
    46
    +  if they are unidirectional).
    
    47
    +
    
    45 48
     - When multiple ``-msse*`` flags are given, the maximum version takes effect.
    
    46 49
       For example, ``-msse4.2 -msse2`` is now equivalent to ``-msse4.2``.
    
    47 50
       Previously, only the last flag took effect.
    
    ... ... @@ -52,6 +55,7 @@ Compiler
    52 55
       in addition to :ghc-flag:`-mavx2`.
    
    53 56
       Refer to the users' guide for more details about each individual flag.
    
    54 57
     
    
    58
    +
    
    55 59
     GHCi
    
    56 60
     ~~~~
    
    57 61
     
    

  • testsuite/tests/ghci/scripts/T8353.stderr
    1
    -
    
    2 1
     Defer03.hs:4:5: warning: [GHC-83865] [-Wdeferred-type-errors (in -Wdefault)]
    
    3 2
         • Couldn't match expected type ‘Int’ with actual type ‘Char’
    
    4 3
         • In the expression: 'p'
    
    ... ... @@ -9,8 +8,8 @@ Defer03.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    9 8
         • In an equation for ‘f’: f = _
    
    10 9
         • Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
    
    11 10
           Valid hole fits include
    
    12
    -        f :: Int (bound at Defer03.hs:7:1)
    
    13 11
             a :: Int (defined at Defer03.hs:4:1)
    
    12
    +        f :: Int (bound at Defer03.hs:7:1)
    
    14 13
             maxBound :: forall a. Bounded a => a
    
    15 14
               with maxBound @Int
    
    16 15
               (imported from ‘Prelude’
    
    ... ... @@ -30,8 +29,8 @@ Defer03.hs:7:5: error: [GHC-88464]
    30 29
         • In an equation for ‘f’: f = _
    
    31 30
         • Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
    
    32 31
           Valid hole fits include
    
    33
    -        f :: Int (bound at Defer03.hs:7:1)
    
    34 32
             a :: Int (defined at Defer03.hs:4:1)
    
    33
    +        f :: Int (bound at Defer03.hs:7:1)
    
    35 34
             maxBound :: forall a. Bounded a => a
    
    36 35
               with maxBound @Int
    
    37 36
               (imported from ‘Prelude’
    
    ... ... @@ -51,8 +50,8 @@ Defer03.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    51 50
         • In an equation for ‘f’: f = _
    
    52 51
         • Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
    
    53 52
           Valid hole fits include
    
    54
    -        f :: Int (bound at Defer03.hs:7:1)
    
    55 53
             a :: Int (defined at Defer03.hs:4:1)
    
    54
    +        f :: Int (bound at Defer03.hs:7:1)
    
    56 55
             maxBound :: forall a. Bounded a => a
    
    57 56
               with maxBound @Int
    
    58 57
               (imported from ‘Prelude’
    
    ... ... @@ -72,8 +71,8 @@ Defer03.hs:7:5: error: [GHC-88464]
    72 71
         • In an equation for ‘f’: f = _
    
    73 72
         • Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
    
    74 73
           Valid hole fits include
    
    75
    -        f :: Int (bound at Defer03.hs:7:1)
    
    76 74
             a :: Int (defined at Defer03.hs:4:1)
    
    75
    +        f :: Int (bound at Defer03.hs:7:1)
    
    77 76
             maxBound :: forall a. Bounded a => a
    
    78 77
               with maxBound @Int
    
    79 78
               (imported from ‘Prelude’
    
    ... ... @@ -93,8 +92,8 @@ Defer03.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    93 92
         • In an equation for ‘f’: f = _
    
    94 93
         • Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
    
    95 94
           Valid hole fits include
    
    96
    -        f :: Int (bound at Defer03.hs:7:1)
    
    97 95
             a :: Int (defined at Defer03.hs:4:1)
    
    96
    +        f :: Int (bound at Defer03.hs:7:1)
    
    98 97
             maxBound :: forall a. Bounded a => a
    
    99 98
               with maxBound @Int
    
    100 99
               (imported from ‘Prelude’
    

  • testsuite/tests/overloadedrecflds/should_fail/DRFHoleFits.stderr
    1
    -
    
    2 1
     DRFHoleFits.hs:7:7: error: [GHC-88464]
    
    3 2
         • Found hole: _ :: T -> Int
    
    4 3
         • In the expression: _ :: T -> Int
    
    ... ... @@ -6,8 +5,8 @@ DRFHoleFits.hs:7:7: error: [GHC-88464]
    6 5
         • Relevant bindings include
    
    7 6
             bar :: T -> Int (bound at DRFHoleFits.hs:7:1)
    
    8 7
           Valid hole fits include
    
    9
    -        foo :: T -> Int (defined at DRFHoleFits.hs:5:16)
    
    10 8
             bar :: T -> Int (defined at DRFHoleFits.hs:7:1)
    
    9
    +        foo :: T -> Int (defined at DRFHoleFits.hs:5:16)
    
    11 10
     
    
    12 11
     DRFHoleFits.hs:8:7: error: [GHC-88464]
    
    13 12
         • Found hole: _ :: A.S -> Int
    
    ... ... @@ -20,3 +19,4 @@ DRFHoleFits.hs:8:7: error: [GHC-88464]
    20 19
             A.foo :: A.S -> Int
    
    21 20
               (imported qualified from ‘DRFHoleFits_A’ at DRFHoleFits.hs:3:1-35
    
    22 21
                (and originally defined at DRFHoleFits_A.hs:5:16-18))
    
    22
    +

  • testsuite/tests/perf/compiler/hard_hole_fits.stderr
    ... ... @@ -299,10 +299,10 @@ hard_hole_fits.hs:29:35: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    299 299
               (bound at hard_hole_fits.hs:29:21)
    
    300 300
             testMe :: HsExpr GhcPs -> Int (bound at hard_hole_fits.hs:14:1)
    
    301 301
           Valid hole fits include
    
    302
    -        n :: Language.Haskell.Syntax.Basic.ConTag
    
    303
    -          (bound at hard_hole_fits.hs:29:25)
    
    304 302
             i :: Language.Haskell.Syntax.Basic.SumWidth
    
    305 303
               (bound at hard_hole_fits.hs:29:27)
    
    304
    +        n :: Language.Haskell.Syntax.Basic.ConTag
    
    305
    +          (bound at hard_hole_fits.hs:29:25)
    
    306 306
             maxBound :: forall a. Bounded a => a
    
    307 307
               with maxBound @Int
    
    308 308
               (imported from ‘Prelude’
    

  • testsuite/tests/plugins/test-hole-plugin.stderr
    1
    -
    
    2 1
     test-hole-plugin.hs:12:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    3 2
         • Found hole: _too_long :: [Int] -> Int
    
    4 3
           Or perhaps ‘_too_long’ is mis-spelled, or not in scope
    
    ... ... @@ -14,11 +13,11 @@ test-hole-plugin.hs:13:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    14 13
         • Relevant bindings include
    
    15 14
             j :: [Int] -> Int (bound at test-hole-plugin.hs:13:1)
    
    16 15
           Valid hole fits include
    
    17
    -        j :: [Int] -> Int
    
    18 16
             f :: [Int] -> Int
    
    19
    -        i :: [Int] -> Int
    
    20 17
             g :: [Int] -> Int
    
    21 18
             h :: [Int] -> Int
    
    19
    +        i :: [Int] -> Int
    
    20
    +        j :: [Int] -> Int
    
    22 21
             head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
    
    23 22
             (Some hole fits suppressed; use -fmax-valid-hole-fits=N or -fno-max-valid-hole-fits)
    
    24 23
     
    
    ... ... @@ -59,3 +58,4 @@ test-hole-plugin.hs:16:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    59 58
             minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
    
    60 59
             product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
    
    61 60
             sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
    
    61
    +

  • testsuite/tests/th/T15321.stderr
    ... ... @@ -6,7 +6,7 @@ T15321.hs:9:9: error: [GHC-88464]
    6 6
             fail :: forall (m :: * -> *) a.
    
    7 7
                     (MonadFail m, GHC.Internal.Stack.Types.HasCallStack) =>
    
    8 8
                     String -> m a
    
    9
    -          with fail @GHC.Internal.TH.Monad.Q @GHC.Internal.TH.Syntax.Exp
    
    9
    +          with fail @GHC.Internal.TH.Monad.Q
    
    10 10
               (imported from ‘Prelude’
    
    11 11
                (and originally defined in ‘GHC.Internal.Control.Monad.Fail’))
    
    12 12
     

  • testsuite/tests/typecheck/should_compile/T13050.stderr
    ... ... @@ -7,13 +7,9 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    7 7
             x :: Int (bound at T13050.hs:4:3)
    
    8 8
             f :: Int -> Int -> Int (bound at T13050.hs:4:1)
    
    9 9
           Valid hole fits include
    
    10
    -        f :: Int -> Int -> Int (bound at T13050.hs:4:1)
    
    11 10
             g :: Int -> Int -> Int (bound at T13050.hs:5:1)
    
    12 11
             q :: Int -> Int -> Int (bound at T13050.hs:6:1)
    
    13
    -        (-) :: forall a. Num a => a -> a -> a
    
    14
    -          with (-) @Int
    
    15
    -          (imported from ‘Prelude’
    
    16
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    12
    +        f :: Int -> Int -> Int (bound at T13050.hs:4:1)
    
    17 13
             asTypeOf :: forall a. a -> a -> a
    
    18 14
               with asTypeOf @Int
    
    19 15
               (imported from ‘Prelude’
    
    ... ... @@ -22,22 +18,6 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    22 18
               with const @Int @Int
    
    23 19
               (imported from ‘Prelude’
    
    24 20
                (and originally defined in ‘GHC.Internal.Base’))
    
    25
    -        subtract :: forall a. Num a => a -> a -> a
    
    26
    -          with subtract @Int
    
    27
    -          (imported from ‘Prelude’
    
    28
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    29
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    30
    -          with (^) @Int @Int
    
    31
    -          (imported from ‘Prelude’
    
    32
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    33
    -        gcd :: forall a. Integral a => a -> a -> a
    
    34
    -          with gcd @Int
    
    35
    -          (imported from ‘Prelude’
    
    36
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    37
    -        lcm :: forall a. Integral a => a -> a -> a
    
    38
    -          with lcm @Int
    
    39
    -          (imported from ‘Prelude’
    
    40
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    41 21
             max :: forall a. Ord a => a -> a -> a
    
    42 22
               with max @Int
    
    43 23
               (imported from ‘Prelude’
    
    ... ... @@ -54,10 +34,30 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    54 34
               with (+) @Int
    
    55 35
               (imported from ‘Prelude’
    
    56 36
                (and originally defined in ‘GHC.Internal.Num’))
    
    37
    +        (-) :: forall a. Num a => a -> a -> a
    
    38
    +          with (-) @Int
    
    39
    +          (imported from ‘Prelude’
    
    40
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    41
    +        subtract :: forall a. Num a => a -> a -> a
    
    42
    +          with subtract @Int
    
    43
    +          (imported from ‘Prelude’
    
    44
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    45
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    46
    +          with (^) @Int @Int
    
    47
    +          (imported from ‘Prelude’
    
    48
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    57 49
             div :: forall a. Integral a => a -> a -> a
    
    58 50
               with div @Int
    
    59 51
               (imported from ‘Prelude’
    
    60 52
                (and originally defined in ‘GHC.Internal.Real’))
    
    53
    +        gcd :: forall a. Integral a => a -> a -> a
    
    54
    +          with gcd @Int
    
    55
    +          (imported from ‘Prelude’
    
    56
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    57
    +        lcm :: forall a. Integral a => a -> a -> a
    
    58
    +          with lcm @Int
    
    59
    +          (imported from ‘Prelude’
    
    60
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    61 61
             mod :: forall a. Integral a => a -> a -> a
    
    62 62
               with mod @Int
    
    63 63
               (imported from ‘Prelude’
    
    ... ... @@ -74,12 +74,12 @@ T13050.hs:4:9: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    74 74
               with seq @Int @Int
    
    75 75
               (imported from ‘Prelude’
    
    76 76
                (and originally defined in ‘GHC.Internal.Prim’))
    
    77
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    78
    -          with return @((->) Int) @Int
    
    77
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    78
    +          with pure @((->) Int)
    
    79 79
               (imported from ‘Prelude’
    
    80 80
                (and originally defined in ‘GHC.Internal.Base’))
    
    81
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    82
    -          with pure @((->) Int) @Int
    
    81
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    82
    +          with return @((->) Int)
    
    83 83
               (imported from ‘Prelude’
    
    84 84
                (and originally defined in ‘GHC.Internal.Base’))
    
    85 85
     
    
    ... ... @@ -92,13 +92,9 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    92 92
             x :: Int (bound at T13050.hs:5:3)
    
    93 93
             g :: Int -> Int -> Int (bound at T13050.hs:5:1)
    
    94 94
           Valid hole fits include
    
    95
    -        g :: Int -> Int -> Int (bound at T13050.hs:5:1)
    
    96 95
             f :: Int -> Int -> Int (defined at T13050.hs:4:1)
    
    97 96
             q :: Int -> Int -> Int (bound at T13050.hs:6:1)
    
    98
    -        (-) :: forall a. Num a => a -> a -> a
    
    99
    -          with (-) @Int
    
    100
    -          (imported from ‘Prelude’
    
    101
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    97
    +        g :: Int -> Int -> Int (bound at T13050.hs:5:1)
    
    102 98
             asTypeOf :: forall a. a -> a -> a
    
    103 99
               with asTypeOf @Int
    
    104 100
               (imported from ‘Prelude’
    
    ... ... @@ -107,22 +103,6 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    107 103
               with const @Int @Int
    
    108 104
               (imported from ‘Prelude’
    
    109 105
                (and originally defined in ‘GHC.Internal.Base’))
    
    110
    -        subtract :: forall a. Num a => a -> a -> a
    
    111
    -          with subtract @Int
    
    112
    -          (imported from ‘Prelude’
    
    113
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    114
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    115
    -          with (^) @Int @Int
    
    116
    -          (imported from ‘Prelude’
    
    117
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    118
    -        gcd :: forall a. Integral a => a -> a -> a
    
    119
    -          with gcd @Int
    
    120
    -          (imported from ‘Prelude’
    
    121
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    122
    -        lcm :: forall a. Integral a => a -> a -> a
    
    123
    -          with lcm @Int
    
    124
    -          (imported from ‘Prelude’
    
    125
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    126 106
             max :: forall a. Ord a => a -> a -> a
    
    127 107
               with max @Int
    
    128 108
               (imported from ‘Prelude’
    
    ... ... @@ -139,10 +119,30 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    139 119
               with (+) @Int
    
    140 120
               (imported from ‘Prelude’
    
    141 121
                (and originally defined in ‘GHC.Internal.Num’))
    
    122
    +        (-) :: forall a. Num a => a -> a -> a
    
    123
    +          with (-) @Int
    
    124
    +          (imported from ‘Prelude’
    
    125
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    126
    +        subtract :: forall a. Num a => a -> a -> a
    
    127
    +          with subtract @Int
    
    128
    +          (imported from ‘Prelude’
    
    129
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    130
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    131
    +          with (^) @Int @Int
    
    132
    +          (imported from ‘Prelude’
    
    133
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    142 134
             div :: forall a. Integral a => a -> a -> a
    
    143 135
               with div @Int
    
    144 136
               (imported from ‘Prelude’
    
    145 137
                (and originally defined in ‘GHC.Internal.Real’))
    
    138
    +        gcd :: forall a. Integral a => a -> a -> a
    
    139
    +          with gcd @Int
    
    140
    +          (imported from ‘Prelude’
    
    141
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    142
    +        lcm :: forall a. Integral a => a -> a -> a
    
    143
    +          with lcm @Int
    
    144
    +          (imported from ‘Prelude’
    
    145
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    146 146
             mod :: forall a. Integral a => a -> a -> a
    
    147 147
               with mod @Int
    
    148 148
               (imported from ‘Prelude’
    
    ... ... @@ -159,12 +159,12 @@ T13050.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    159 159
               with seq @Int @Int
    
    160 160
               (imported from ‘Prelude’
    
    161 161
                (and originally defined in ‘GHC.Internal.Prim’))
    
    162
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    163
    -          with return @((->) Int) @Int
    
    162
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    163
    +          with pure @((->) Int)
    
    164 164
               (imported from ‘Prelude’
    
    165 165
                (and originally defined in ‘GHC.Internal.Base’))
    
    166
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    167
    -          with pure @((->) Int) @Int
    
    166
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    167
    +          with return @((->) Int)
    
    168 168
               (imported from ‘Prelude’
    
    169 169
                (and originally defined in ‘GHC.Internal.Base’))
    
    170 170
     
    
    ... ... @@ -178,13 +178,9 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    178 178
             x :: Int (bound at T13050.hs:6:3)
    
    179 179
             q :: Int -> Int -> Int (bound at T13050.hs:6:1)
    
    180 180
           Valid hole fits include
    
    181
    -        q :: Int -> Int -> Int (bound at T13050.hs:6:1)
    
    182 181
             f :: Int -> Int -> Int (defined at T13050.hs:4:1)
    
    183 182
             g :: Int -> Int -> Int (defined at T13050.hs:5:1)
    
    184
    -        (-) :: forall a. Num a => a -> a -> a
    
    185
    -          with (-) @Int
    
    186
    -          (imported from ‘Prelude’
    
    187
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    183
    +        q :: Int -> Int -> Int (bound at T13050.hs:6:1)
    
    188 184
             asTypeOf :: forall a. a -> a -> a
    
    189 185
               with asTypeOf @Int
    
    190 186
               (imported from ‘Prelude’
    
    ... ... @@ -193,22 +189,6 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    193 189
               with const @Int @Int
    
    194 190
               (imported from ‘Prelude’
    
    195 191
                (and originally defined in ‘GHC.Internal.Base’))
    
    196
    -        subtract :: forall a. Num a => a -> a -> a
    
    197
    -          with subtract @Int
    
    198
    -          (imported from ‘Prelude’
    
    199
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    200
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    201
    -          with (^) @Int @Int
    
    202
    -          (imported from ‘Prelude’
    
    203
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    204
    -        gcd :: forall a. Integral a => a -> a -> a
    
    205
    -          with gcd @Int
    
    206
    -          (imported from ‘Prelude’
    
    207
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    208
    -        lcm :: forall a. Integral a => a -> a -> a
    
    209
    -          with lcm @Int
    
    210
    -          (imported from ‘Prelude’
    
    211
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    212 192
             max :: forall a. Ord a => a -> a -> a
    
    213 193
               with max @Int
    
    214 194
               (imported from ‘Prelude’
    
    ... ... @@ -225,10 +205,30 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    225 205
               with (+) @Int
    
    226 206
               (imported from ‘Prelude’
    
    227 207
                (and originally defined in ‘GHC.Internal.Num’))
    
    208
    +        (-) :: forall a. Num a => a -> a -> a
    
    209
    +          with (-) @Int
    
    210
    +          (imported from ‘Prelude’
    
    211
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    212
    +        subtract :: forall a. Num a => a -> a -> a
    
    213
    +          with subtract @Int
    
    214
    +          (imported from ‘Prelude’
    
    215
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    216
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    217
    +          with (^) @Int @Int
    
    218
    +          (imported from ‘Prelude’
    
    219
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    228 220
             div :: forall a. Integral a => a -> a -> a
    
    229 221
               with div @Int
    
    230 222
               (imported from ‘Prelude’
    
    231 223
                (and originally defined in ‘GHC.Internal.Real’))
    
    224
    +        gcd :: forall a. Integral a => a -> a -> a
    
    225
    +          with gcd @Int
    
    226
    +          (imported from ‘Prelude’
    
    227
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    228
    +        lcm :: forall a. Integral a => a -> a -> a
    
    229
    +          with lcm @Int
    
    230
    +          (imported from ‘Prelude’
    
    231
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    232 232
             mod :: forall a. Integral a => a -> a -> a
    
    233 233
               with mod @Int
    
    234 234
               (imported from ‘Prelude’
    
    ... ... @@ -245,12 +245,12 @@ T13050.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    245 245
               with seq @Int @Int
    
    246 246
               (imported from ‘Prelude’
    
    247 247
                (and originally defined in ‘GHC.Internal.Prim’))
    
    248
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    249
    -          with return @((->) Int) @Int
    
    248
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    249
    +          with pure @((->) Int)
    
    250 250
               (imported from ‘Prelude’
    
    251 251
                (and originally defined in ‘GHC.Internal.Base’))
    
    252
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    253
    -          with pure @((->) Int) @Int
    
    252
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    253
    +          with return @((->) Int)
    
    254 254
               (imported from ‘Prelude’
    
    255 255
                (and originally defined in ‘GHC.Internal.Base’))
    
    256 256
     

  • testsuite/tests/typecheck/should_compile/T14273.stderr
    ... ... @@ -28,27 +28,27 @@ T14273.hs:7:32: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    28 28
             pleaseShow :: Bool -> a -> Maybe String (bound at T14273.hs:6:1)
    
    29 29
           Constraints include Show a (from T14273.hs:5:1-49)
    
    30 30
           Valid hole fits include
    
    31
    -        a :: a (bound at T14273.hs:7:17)
    
    32 31
             k :: String (bound at T14273.hs:10:1)
    
    32
    +        a :: a (bound at T14273.hs:7:17)
    
    33 33
             otherwise :: Bool
    
    34 34
               (imported from ‘Prelude’
    
    35 35
                (and originally defined in ‘GHC.Internal.Base’))
    
    36
    -        False :: Bool
    
    36
    +        EQ :: Ordering
    
    37 37
               (imported from ‘Prelude’
    
    38 38
                (and originally defined in ‘GHC.Internal.Types’))
    
    39
    -        True :: Bool
    
    39
    +        GT :: Ordering
    
    40 40
               (imported from ‘Prelude’
    
    41 41
                (and originally defined in ‘GHC.Internal.Types’))
    
    42 42
             LT :: Ordering
    
    43 43
               (imported from ‘Prelude’
    
    44 44
                (and originally defined in ‘GHC.Internal.Types’))
    
    45
    -        EQ :: Ordering
    
    45
    +        () :: () (bound at <wired into compiler>)
    
    46
    +        False :: Bool
    
    46 47
               (imported from ‘Prelude’
    
    47 48
                (and originally defined in ‘GHC.Internal.Types’))
    
    48
    -        GT :: Ordering
    
    49
    +        True :: Bool
    
    49 50
               (imported from ‘Prelude’
    
    50 51
                (and originally defined in ‘GHC.Internal.Types’))
    
    51
    -        () :: () (bound at <wired into compiler>)
    
    52 52
             pi :: forall a. Floating a => a
    
    53 53
               with pi @Double
    
    54 54
               (imported from ‘Prelude’
    

  • testsuite/tests/typecheck/should_compile/T14590.stderr
    ... ... @@ -8,14 +8,10 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    8 8
             x :: Int (bound at T14590.hs:4:4)
    
    9 9
             f1 :: Int -> Int -> Int (bound at T14590.hs:4:1)
    
    10 10
           Valid hole fits include
    
    11
    -        f1 :: Int -> Int -> Int (bound at T14590.hs:4:1)
    
    12 11
             f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
    
    13 12
             f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
    
    14 13
             f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
    
    15
    -        (-) :: forall a. Num a => a -> a -> a
    
    16
    -          with (-) @Int
    
    17
    -          (imported from ‘Prelude’
    
    18
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    14
    +        f1 :: Int -> Int -> Int (bound at T14590.hs:4:1)
    
    19 15
             asTypeOf :: forall a. a -> a -> a
    
    20 16
               with asTypeOf @Int
    
    21 17
               (imported from ‘Prelude’
    
    ... ... @@ -24,22 +20,6 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    24 20
               with const @Int @Int
    
    25 21
               (imported from ‘Prelude’
    
    26 22
                (and originally defined in ‘GHC.Internal.Base’))
    
    27
    -        subtract :: forall a. Num a => a -> a -> a
    
    28
    -          with subtract @Int
    
    29
    -          (imported from ‘Prelude’
    
    30
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    31
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    32
    -          with (^) @Int @Int
    
    33
    -          (imported from ‘Prelude’
    
    34
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    35
    -        gcd :: forall a. Integral a => a -> a -> a
    
    36
    -          with gcd @Int
    
    37
    -          (imported from ‘Prelude’
    
    38
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    39
    -        lcm :: forall a. Integral a => a -> a -> a
    
    40
    -          with lcm @Int
    
    41
    -          (imported from ‘Prelude’
    
    42
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    43 23
             max :: forall a. Ord a => a -> a -> a
    
    44 24
               with max @Int
    
    45 25
               (imported from ‘Prelude’
    
    ... ... @@ -56,10 +36,30 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    56 36
               with (+) @Int
    
    57 37
               (imported from ‘Prelude’
    
    58 38
                (and originally defined in ‘GHC.Internal.Num’))
    
    39
    +        (-) :: forall a. Num a => a -> a -> a
    
    40
    +          with (-) @Int
    
    41
    +          (imported from ‘Prelude’
    
    42
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    43
    +        subtract :: forall a. Num a => a -> a -> a
    
    44
    +          with subtract @Int
    
    45
    +          (imported from ‘Prelude’
    
    46
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    47
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    48
    +          with (^) @Int @Int
    
    49
    +          (imported from ‘Prelude’
    
    50
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    59 51
             div :: forall a. Integral a => a -> a -> a
    
    60 52
               with div @Int
    
    61 53
               (imported from ‘Prelude’
    
    62 54
                (and originally defined in ‘GHC.Internal.Real’))
    
    55
    +        gcd :: forall a. Integral a => a -> a -> a
    
    56
    +          with gcd @Int
    
    57
    +          (imported from ‘Prelude’
    
    58
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    59
    +        lcm :: forall a. Integral a => a -> a -> a
    
    60
    +          with lcm @Int
    
    61
    +          (imported from ‘Prelude’
    
    62
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    63 63
             mod :: forall a. Integral a => a -> a -> a
    
    64 64
               with mod @Int
    
    65 65
               (imported from ‘Prelude’
    
    ... ... @@ -76,12 +76,12 @@ T14590.hs:4:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    76 76
               with seq @Int @Int
    
    77 77
               (imported from ‘Prelude’
    
    78 78
                (and originally defined in ‘GHC.Internal.Prim’))
    
    79
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    80
    -          with return @((->) Int) @Int
    
    79
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    80
    +          with pure @((->) Int)
    
    81 81
               (imported from ‘Prelude’
    
    82 82
                (and originally defined in ‘GHC.Internal.Base’))
    
    83
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    84
    -          with pure @((->) Int) @Int
    
    83
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    84
    +          with return @((->) Int)
    
    85 85
               (imported from ‘Prelude’
    
    86 86
                (and originally defined in ‘GHC.Internal.Base’))
    
    87 87
     
    
    ... ... @@ -96,14 +96,10 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    96 96
             x :: Int (bound at T14590.hs:5:4)
    
    97 97
             f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
    
    98 98
           Valid hole fits include
    
    99
    -        f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
    
    100 99
             f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
    
    101 100
             f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
    
    102 101
             f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
    
    103
    -        (-) :: forall a. Num a => a -> a -> a
    
    104
    -          with (-) @Int
    
    105
    -          (imported from ‘Prelude’
    
    106
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    102
    +        f2 :: Int -> Int -> Int (bound at T14590.hs:5:1)
    
    107 103
             asTypeOf :: forall a. a -> a -> a
    
    108 104
               with asTypeOf @Int
    
    109 105
               (imported from ‘Prelude’
    
    ... ... @@ -112,22 +108,6 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    112 108
               with const @Int @Int
    
    113 109
               (imported from ‘Prelude’
    
    114 110
                (and originally defined in ‘GHC.Internal.Base’))
    
    115
    -        subtract :: forall a. Num a => a -> a -> a
    
    116
    -          with subtract @Int
    
    117
    -          (imported from ‘Prelude’
    
    118
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    119
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    120
    -          with (^) @Int @Int
    
    121
    -          (imported from ‘Prelude’
    
    122
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    123
    -        gcd :: forall a. Integral a => a -> a -> a
    
    124
    -          with gcd @Int
    
    125
    -          (imported from ‘Prelude’
    
    126
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    127
    -        lcm :: forall a. Integral a => a -> a -> a
    
    128
    -          with lcm @Int
    
    129
    -          (imported from ‘Prelude’
    
    130
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    131 111
             max :: forall a. Ord a => a -> a -> a
    
    132 112
               with max @Int
    
    133 113
               (imported from ‘Prelude’
    
    ... ... @@ -144,10 +124,30 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    144 124
               with (+) @Int
    
    145 125
               (imported from ‘Prelude’
    
    146 126
                (and originally defined in ‘GHC.Internal.Num’))
    
    127
    +        (-) :: forall a. Num a => a -> a -> a
    
    128
    +          with (-) @Int
    
    129
    +          (imported from ‘Prelude’
    
    130
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    131
    +        subtract :: forall a. Num a => a -> a -> a
    
    132
    +          with subtract @Int
    
    133
    +          (imported from ‘Prelude’
    
    134
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    135
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    136
    +          with (^) @Int @Int
    
    137
    +          (imported from ‘Prelude’
    
    138
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    147 139
             div :: forall a. Integral a => a -> a -> a
    
    148 140
               with div @Int
    
    149 141
               (imported from ‘Prelude’
    
    150 142
                (and originally defined in ‘GHC.Internal.Real’))
    
    143
    +        gcd :: forall a. Integral a => a -> a -> a
    
    144
    +          with gcd @Int
    
    145
    +          (imported from ‘Prelude’
    
    146
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    147
    +        lcm :: forall a. Integral a => a -> a -> a
    
    148
    +          with lcm @Int
    
    149
    +          (imported from ‘Prelude’
    
    150
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    151 151
             mod :: forall a. Integral a => a -> a -> a
    
    152 152
               with mod @Int
    
    153 153
               (imported from ‘Prelude’
    
    ... ... @@ -164,12 +164,12 @@ T14590.hs:5:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    164 164
               with seq @Int @Int
    
    165 165
               (imported from ‘Prelude’
    
    166 166
                (and originally defined in ‘GHC.Internal.Prim’))
    
    167
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    168
    -          with return @((->) Int) @Int
    
    167
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    168
    +          with pure @((->) Int)
    
    169 169
               (imported from ‘Prelude’
    
    170 170
                (and originally defined in ‘GHC.Internal.Base’))
    
    171
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    172
    -          with pure @((->) Int) @Int
    
    171
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    172
    +          with return @((->) Int)
    
    173 173
               (imported from ‘Prelude’
    
    174 174
                (and originally defined in ‘GHC.Internal.Base’))
    
    175 175
     
    
    ... ... @@ -182,14 +182,10 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    182 182
             x :: Int (bound at T14590.hs:6:4)
    
    183 183
             f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
    
    184 184
           Valid hole fits include
    
    185
    -        f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
    
    186 185
             f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
    
    187 186
             f2 :: Int -> Int -> Int (defined at T14590.hs:5:1)
    
    188 187
             f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
    
    189
    -        (-) :: forall a. Num a => a -> a -> a
    
    190
    -          with (-) @Int
    
    191
    -          (imported from ‘Prelude’
    
    192
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    188
    +        f3 :: Int -> Int -> Int (bound at T14590.hs:6:1)
    
    193 189
             asTypeOf :: forall a. a -> a -> a
    
    194 190
               with asTypeOf @Int
    
    195 191
               (imported from ‘Prelude’
    
    ... ... @@ -198,22 +194,6 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    198 194
               with const @Int @Int
    
    199 195
               (imported from ‘Prelude’
    
    200 196
                (and originally defined in ‘GHC.Internal.Base’))
    
    201
    -        subtract :: forall a. Num a => a -> a -> a
    
    202
    -          with subtract @Int
    
    203
    -          (imported from ‘Prelude’
    
    204
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    205
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    206
    -          with (^) @Int @Int
    
    207
    -          (imported from ‘Prelude’
    
    208
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    209
    -        gcd :: forall a. Integral a => a -> a -> a
    
    210
    -          with gcd @Int
    
    211
    -          (imported from ‘Prelude’
    
    212
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    213
    -        lcm :: forall a. Integral a => a -> a -> a
    
    214
    -          with lcm @Int
    
    215
    -          (imported from ‘Prelude’
    
    216
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    217 197
             max :: forall a. Ord a => a -> a -> a
    
    218 198
               with max @Int
    
    219 199
               (imported from ‘Prelude’
    
    ... ... @@ -230,10 +210,30 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    230 210
               with (+) @Int
    
    231 211
               (imported from ‘Prelude’
    
    232 212
                (and originally defined in ‘GHC.Internal.Num’))
    
    213
    +        (-) :: forall a. Num a => a -> a -> a
    
    214
    +          with (-) @Int
    
    215
    +          (imported from ‘Prelude’
    
    216
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    217
    +        subtract :: forall a. Num a => a -> a -> a
    
    218
    +          with subtract @Int
    
    219
    +          (imported from ‘Prelude’
    
    220
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    221
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    222
    +          with (^) @Int @Int
    
    223
    +          (imported from ‘Prelude’
    
    224
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    233 225
             div :: forall a. Integral a => a -> a -> a
    
    234 226
               with div @Int
    
    235 227
               (imported from ‘Prelude’
    
    236 228
                (and originally defined in ‘GHC.Internal.Real’))
    
    229
    +        gcd :: forall a. Integral a => a -> a -> a
    
    230
    +          with gcd @Int
    
    231
    +          (imported from ‘Prelude’
    
    232
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    233
    +        lcm :: forall a. Integral a => a -> a -> a
    
    234
    +          with lcm @Int
    
    235
    +          (imported from ‘Prelude’
    
    236
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    237 237
             mod :: forall a. Integral a => a -> a -> a
    
    238 238
               with mod @Int
    
    239 239
               (imported from ‘Prelude’
    
    ... ... @@ -250,12 +250,12 @@ T14590.hs:6:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    250 250
               with seq @Int @Int
    
    251 251
               (imported from ‘Prelude’
    
    252 252
                (and originally defined in ‘GHC.Internal.Prim’))
    
    253
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    254
    -          with return @((->) Int) @Int
    
    253
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    254
    +          with pure @((->) Int)
    
    255 255
               (imported from ‘Prelude’
    
    256 256
                (and originally defined in ‘GHC.Internal.Base’))
    
    257
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    258
    -          with pure @((->) Int) @Int
    
    257
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    258
    +          with return @((->) Int)
    
    259 259
               (imported from ‘Prelude’
    
    260 260
                (and originally defined in ‘GHC.Internal.Base’))
    
    261 261
     
    
    ... ... @@ -269,14 +269,10 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    269 269
             x :: Int (bound at T14590.hs:7:4)
    
    270 270
             f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
    
    271 271
           Valid hole fits include
    
    272
    -        f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
    
    273 272
             f1 :: Int -> Int -> Int (defined at T14590.hs:4:1)
    
    274 273
             f2 :: Int -> Int -> Int (defined at T14590.hs:5:1)
    
    275 274
             f3 :: Int -> Int -> Int (defined at T14590.hs:6:1)
    
    276
    -        (-) :: forall a. Num a => a -> a -> a
    
    277
    -          with (-) @Int
    
    278
    -          (imported from ‘Prelude’
    
    279
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    275
    +        f4 :: Int -> Int -> Int (bound at T14590.hs:7:1)
    
    280 276
             asTypeOf :: forall a. a -> a -> a
    
    281 277
               with asTypeOf @Int
    
    282 278
               (imported from ‘Prelude’
    
    ... ... @@ -285,22 +281,6 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    285 281
               with const @Int @Int
    
    286 282
               (imported from ‘Prelude’
    
    287 283
                (and originally defined in ‘GHC.Internal.Base’))
    
    288
    -        subtract :: forall a. Num a => a -> a -> a
    
    289
    -          with subtract @Int
    
    290
    -          (imported from ‘Prelude’
    
    291
    -           (and originally defined in ‘GHC.Internal.Num’))
    
    292
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    293
    -          with (^) @Int @Int
    
    294
    -          (imported from ‘Prelude’
    
    295
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    296
    -        gcd :: forall a. Integral a => a -> a -> a
    
    297
    -          with gcd @Int
    
    298
    -          (imported from ‘Prelude’
    
    299
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    300
    -        lcm :: forall a. Integral a => a -> a -> a
    
    301
    -          with lcm @Int
    
    302
    -          (imported from ‘Prelude’
    
    303
    -           (and originally defined in ‘GHC.Internal.Real’))
    
    304 284
             max :: forall a. Ord a => a -> a -> a
    
    305 285
               with max @Int
    
    306 286
               (imported from ‘Prelude’
    
    ... ... @@ -317,10 +297,30 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    317 297
               with (+) @Int
    
    318 298
               (imported from ‘Prelude’
    
    319 299
                (and originally defined in ‘GHC.Internal.Num’))
    
    300
    +        (-) :: forall a. Num a => a -> a -> a
    
    301
    +          with (-) @Int
    
    302
    +          (imported from ‘Prelude’
    
    303
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    304
    +        subtract :: forall a. Num a => a -> a -> a
    
    305
    +          with subtract @Int
    
    306
    +          (imported from ‘Prelude’
    
    307
    +           (and originally defined in ‘GHC.Internal.Num’))
    
    308
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    309
    +          with (^) @Int @Int
    
    310
    +          (imported from ‘Prelude’
    
    311
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    320 312
             div :: forall a. Integral a => a -> a -> a
    
    321 313
               with div @Int
    
    322 314
               (imported from ‘Prelude’
    
    323 315
                (and originally defined in ‘GHC.Internal.Real’))
    
    316
    +        gcd :: forall a. Integral a => a -> a -> a
    
    317
    +          with gcd @Int
    
    318
    +          (imported from ‘Prelude’
    
    319
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    320
    +        lcm :: forall a. Integral a => a -> a -> a
    
    321
    +          with lcm @Int
    
    322
    +          (imported from ‘Prelude’
    
    323
    +           (and originally defined in ‘GHC.Internal.Real’))
    
    324 324
             mod :: forall a. Integral a => a -> a -> a
    
    325 325
               with mod @Int
    
    326 326
               (imported from ‘Prelude’
    
    ... ... @@ -337,12 +337,12 @@ T14590.hs:7:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    337 337
               with seq @Int @Int
    
    338 338
               (imported from ‘Prelude’
    
    339 339
                (and originally defined in ‘GHC.Internal.Prim’))
    
    340
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    341
    -          with return @((->) Int) @Int
    
    340
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    341
    +          with pure @((->) Int)
    
    342 342
               (imported from ‘Prelude’
    
    343 343
                (and originally defined in ‘GHC.Internal.Base’))
    
    344
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    345
    -          with pure @((->) Int) @Int
    
    344
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    345
    +          with return @((->) Int)
    
    346 346
               (imported from ‘Prelude’
    
    347 347
                (and originally defined in ‘GHC.Internal.Base’))
    
    348 348
     

  • testsuite/tests/typecheck/should_compile/T25180.stderr
    ... ... @@ -29,16 +29,20 @@ T25180.hs:19:8: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    29 29
             tup1 :: a -> Solo a (bound at T25180.hs:19:1)
    
    30 30
           Valid hole fits include
    
    31 31
             tup1 :: a -> Solo a (bound at T25180.hs:19:1)
    
    32
    +        Solo :: forall a. a -> Solo a
    
    33
    +          with Solo @a
    
    34
    +          (imported from ‘Data.Tuple’ at T25180.hs:6:1-17
    
    35
    +           (and originally defined in ‘GHC.Internal.Tuple’))
    
    32 36
             MkSolo :: forall a. a -> Solo a
    
    33 37
               with MkSolo @a
    
    34 38
               (imported from ‘Data.Tuple’ at T25180.hs:6:1-17
    
    35 39
                (and originally defined in ‘GHC.Internal.Tuple’))
    
    36
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    37
    -          with return @Solo @a
    
    40
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    41
    +          with pure @Solo
    
    38 42
               (imported from ‘Prelude’
    
    39 43
                (and originally defined in ‘GHC.Internal.Base’))
    
    40
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    41
    -          with pure @Solo @a
    
    44
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    45
    +          with return @Solo
    
    42 46
               (imported from ‘Prelude’
    
    43 47
                (and originally defined in ‘GHC.Internal.Base’))
    
    44 48
     
    

  • testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr
    1
    -
    
    2 1
     abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    3 2
         • Found hole: _ :: [Integer] -> Integer
    
    4 3
         • In an equation for ‘f’: f = _
    
    ... ... @@ -6,8 +5,8 @@ abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -W
    6 5
             f :: [Integer] -> Integer
    
    7 6
               (bound at abstract_refinement_hole_fits.hs:4:1)
    
    8 7
           Valid hole fits include
    
    9
    -        f :: [Integer] -> Integer
    
    10 8
             g :: [Integer] -> Integer
    
    9
    +        f :: [Integer] -> Integer
    
    11 10
             head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
    
    12 11
             last :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
    
    13 12
             maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
    
    ... ... @@ -61,46 +60,46 @@ abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -W
    61 60
               where fst :: forall a b. (a, b) -> a
    
    62 61
             snd (_ :: (a3, t0 -> [Integer] -> Integer)) (_ :: t0)
    
    63 62
               where snd :: forall a b. (a, b) -> b
    
    64
    -        return (_ :: Integer)
    
    65
    -          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    66 63
             pure (_ :: Integer)
    
    67 64
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    68
    -        (>>=) (_ :: [Integer] -> a6) (_ :: a6 -> [Integer] -> Integer)
    
    69
    -          where (>>=) :: forall (m :: * -> *) a b.
    
    70
    -                         Monad m =>
    
    71
    -                         m a -> (a -> m b) -> m b
    
    72
    -        (>>) (_ :: [Integer] -> a5) (_ :: [Integer] -> Integer)
    
    73
    -          where (>>) :: forall (m :: * -> *) a b.
    
    74
    -                        Monad m =>
    
    75
    -                        m a -> m b -> m b
    
    76
    -        fmap (_ :: a7 -> Integer) (_ :: [Integer] -> a7)
    
    77
    -          where fmap :: forall (f :: * -> *) a b.
    
    65
    +        return (_ :: Integer)
    
    66
    +          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    67
    +        (*>) (_ :: [Integer] -> a8) (_ :: [Integer] -> Integer)
    
    68
    +          where (*>) :: forall (f :: * -> *) a b.
    
    69
    +                        Applicative f =>
    
    70
    +                        f a -> f b -> f b
    
    71
    +        (<$) (_ :: Integer) (_ :: [Integer] -> b5)
    
    72
    +          where (<$) :: forall (f :: * -> *) a b.
    
    78 73
                             Functor f =>
    
    79
    -                        (a -> b) -> f a -> f b
    
    74
    +                        a -> f b -> f a
    
    75
    +        (<*) (_ :: [Integer] -> Integer) (_ :: [Integer] -> b4)
    
    76
    +          where (<*) :: forall (f :: * -> *) a b.
    
    77
    +                        Applicative f =>
    
    78
    +                        f a -> f b -> f a
    
    80 79
             (<*>) (_ :: [Integer] -> a9 -> Integer) (_ :: [Integer] -> a9)
    
    81 80
               where (<*>) :: forall (f :: * -> *) a b.
    
    82 81
                              Applicative f =>
    
    83 82
                              f (a -> b) -> f a -> f b
    
    84
    -        (*>) (_ :: [Integer] -> a8) (_ :: [Integer] -> Integer)
    
    85
    -          where (*>) :: forall (f :: * -> *) a b.
    
    86
    -                        Applicative f =>
    
    87
    -                        f a -> f b -> f b
    
    88 83
             (=<<) (_ :: a1 -> [Integer] -> Integer) (_ :: [Integer] -> a1)
    
    89 84
               where (=<<) :: forall (m :: * -> *) a b.
    
    90 85
                              Monad m =>
    
    91 86
                              (a -> m b) -> m a -> m b
    
    87
    +        (>>) (_ :: [Integer] -> a5) (_ :: [Integer] -> Integer)
    
    88
    +          where (>>) :: forall (m :: * -> *) a b.
    
    89
    +                        Monad m =>
    
    90
    +                        m a -> m b -> m b
    
    91
    +        (>>=) (_ :: [Integer] -> a6) (_ :: a6 -> [Integer] -> Integer)
    
    92
    +          where (>>=) :: forall (m :: * -> *) a b.
    
    93
    +                         Monad m =>
    
    94
    +                         m a -> (a -> m b) -> m b
    
    95
    +        fmap (_ :: a7 -> Integer) (_ :: [Integer] -> a7)
    
    96
    +          where fmap :: forall (f :: * -> *) a b.
    
    97
    +                        Functor f =>
    
    98
    +                        (a -> b) -> f a -> f b
    
    92 99
             (<$>) (_ :: a2 -> Integer) (_ :: [Integer] -> a2)
    
    93 100
               where (<$>) :: forall (f :: * -> *) a b.
    
    94 101
                              Functor f =>
    
    95 102
                              (a -> b) -> f a -> f b
    
    96
    -        (<*) (_ :: [Integer] -> Integer) (_ :: [Integer] -> b4)
    
    97
    -          where (<*) :: forall (f :: * -> *) a b.
    
    98
    -                        Applicative f =>
    
    99
    -                        f a -> f b -> f a
    
    100
    -        (<$) (_ :: Integer) (_ :: [Integer] -> b5)
    
    101
    -          where (<$) :: forall (f :: * -> *) a b.
    
    102
    -                        Functor f =>
    
    103
    -                        a -> f b -> f a
    
    104 103
             id (_ :: [Integer] -> Integer)
    
    105 104
               where id :: forall a. a -> a
    
    106 105
             head (_ :: [[Integer] -> Integer])
    
    ... ... @@ -125,16 +124,16 @@ abstract_refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -W
    125 124
               where const :: forall a b. a -> b -> a
    
    126 125
             uncurry (_ :: a4 -> b3 -> [Integer] -> Integer) (_ :: (a4, b3))
    
    127 126
               where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c
    
    128
    -        seq (_ :: t2) (_ :: [Integer] -> Integer)
    
    129
    -          where seq :: forall a b. a -> b -> b
    
    130 127
             ($!) (_ :: t0 -> [Integer] -> Integer) (_ :: t0)
    
    131 128
               where ($!) :: forall a b. (a -> b) -> a -> b
    
    129
    +        seq (_ :: t2) (_ :: [Integer] -> Integer)
    
    130
    +          where seq :: forall a b. a -> b -> b
    
    132 131
             ($) (_ :: t0 -> [Integer] -> Integer) (_ :: t0)
    
    133 132
               where ($) :: forall a b. (a -> b) -> a -> b
    
    134
    -        return (_ :: [Integer] -> Integer) (_ :: t0)
    
    135
    -          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    136 133
             pure (_ :: [Integer] -> Integer) (_ :: t0)
    
    137 134
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    135
    +        return (_ :: [Integer] -> Integer) (_ :: t0)
    
    136
    +          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    138 137
     
    
    139 138
     abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    140 139
         • Found hole: _ :: Integer -> [Integer] -> Integer
    
    ... ... @@ -145,8 +144,8 @@ abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -W
    145 144
               (bound at abstract_refinement_hole_fits.hs:7:1)
    
    146 145
           Valid hole fits include
    
    147 146
             const :: forall a b. a -> b -> a
    
    148
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    149 147
             pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    148
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    150 149
           Valid refinement hole fits include
    
    151 150
             foldl (_ :: Integer -> Integer -> Integer)
    
    152 151
               where foldl :: forall (t :: * -> *) b a.
    
    ... ... @@ -190,49 +189,49 @@ abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -W
    190 189
               where fst :: forall a b. (a, b) -> a
    
    191 190
             snd (_ :: (a3, t0 -> Integer -> [Integer] -> Integer)) (_ :: t0)
    
    192 191
               where snd :: forall a b. (a, b) -> b
    
    193
    -        return (_ :: [Integer] -> Integer)
    
    194
    -          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    195 192
             pure (_ :: [Integer] -> Integer)
    
    196 193
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    197
    -        (>>=) (_ :: Integer -> a6)
    
    198
    -              (_ :: a6 -> Integer -> [Integer] -> Integer)
    
    199
    -          where (>>=) :: forall (m :: * -> *) a b.
    
    200
    -                         Monad m =>
    
    201
    -                         m a -> (a -> m b) -> m b
    
    202
    -        (>>) (_ :: Integer -> a5) (_ :: Integer -> [Integer] -> Integer)
    
    203
    -          where (>>) :: forall (m :: * -> *) a b.
    
    204
    -                        Monad m =>
    
    205
    -                        m a -> m b -> m b
    
    206
    -        fmap (_ :: a7 -> [Integer] -> Integer) (_ :: Integer -> a7)
    
    207
    -          where fmap :: forall (f :: * -> *) a b.
    
    194
    +        return (_ :: [Integer] -> Integer)
    
    195
    +          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    196
    +        (*>) (_ :: Integer -> a8) (_ :: Integer -> [Integer] -> Integer)
    
    197
    +          where (*>) :: forall (f :: * -> *) a b.
    
    198
    +                        Applicative f =>
    
    199
    +                        f a -> f b -> f b
    
    200
    +        (<$) (_ :: [Integer] -> Integer) (_ :: Integer -> b5)
    
    201
    +          where (<$) :: forall (f :: * -> *) a b.
    
    208 202
                             Functor f =>
    
    209
    -                        (a -> b) -> f a -> f b
    
    203
    +                        a -> f b -> f a
    
    204
    +        (<*) (_ :: Integer -> [Integer] -> Integer) (_ :: Integer -> b4)
    
    205
    +          where (<*) :: forall (f :: * -> *) a b.
    
    206
    +                        Applicative f =>
    
    207
    +                        f a -> f b -> f a
    
    210 208
             (<*>) (_ :: Integer -> a9 -> [Integer] -> Integer)
    
    211 209
                   (_ :: Integer -> a9)
    
    212 210
               where (<*>) :: forall (f :: * -> *) a b.
    
    213 211
                              Applicative f =>
    
    214 212
                              f (a -> b) -> f a -> f b
    
    215
    -        (*>) (_ :: Integer -> a8) (_ :: Integer -> [Integer] -> Integer)
    
    216
    -          where (*>) :: forall (f :: * -> *) a b.
    
    217
    -                        Applicative f =>
    
    218
    -                        f a -> f b -> f b
    
    219 213
             (=<<) (_ :: a1 -> Integer -> [Integer] -> Integer)
    
    220 214
                   (_ :: Integer -> a1)
    
    221 215
               where (=<<) :: forall (m :: * -> *) a b.
    
    222 216
                              Monad m =>
    
    223 217
                              (a -> m b) -> m a -> m b
    
    218
    +        (>>) (_ :: Integer -> a5) (_ :: Integer -> [Integer] -> Integer)
    
    219
    +          where (>>) :: forall (m :: * -> *) a b.
    
    220
    +                        Monad m =>
    
    221
    +                        m a -> m b -> m b
    
    222
    +        (>>=) (_ :: Integer -> a6)
    
    223
    +              (_ :: a6 -> Integer -> [Integer] -> Integer)
    
    224
    +          where (>>=) :: forall (m :: * -> *) a b.
    
    225
    +                         Monad m =>
    
    226
    +                         m a -> (a -> m b) -> m b
    
    227
    +        fmap (_ :: a7 -> [Integer] -> Integer) (_ :: Integer -> a7)
    
    228
    +          where fmap :: forall (f :: * -> *) a b.
    
    229
    +                        Functor f =>
    
    230
    +                        (a -> b) -> f a -> f b
    
    224 231
             (<$>) (_ :: a2 -> [Integer] -> Integer) (_ :: Integer -> a2)
    
    225 232
               where (<$>) :: forall (f :: * -> *) a b.
    
    226 233
                              Functor f =>
    
    227 234
                              (a -> b) -> f a -> f b
    
    228
    -        (<*) (_ :: Integer -> [Integer] -> Integer) (_ :: Integer -> b4)
    
    229
    -          where (<*) :: forall (f :: * -> *) a b.
    
    230
    -                        Applicative f =>
    
    231
    -                        f a -> f b -> f a
    
    232
    -        (<$) (_ :: [Integer] -> Integer) (_ :: Integer -> b5)
    
    233
    -          where (<$) :: forall (f :: * -> *) a b.
    
    234
    -                        Functor f =>
    
    235
    -                        a -> f b -> f a
    
    236 235
             id (_ :: Integer -> [Integer] -> Integer)
    
    237 236
               where id :: forall a. a -> a
    
    238 237
             head (_ :: [Integer -> [Integer] -> Integer])
    
    ... ... @@ -259,13 +258,14 @@ abstract_refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -W
    259 258
             uncurry (_ :: a4 -> b3 -> Integer -> [Integer] -> Integer)
    
    260 259
                     (_ :: (a4, b3))
    
    261 260
               where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c
    
    262
    -        seq (_ :: t2) (_ :: Integer -> [Integer] -> Integer)
    
    263
    -          where seq :: forall a b. a -> b -> b
    
    264 261
             ($!) (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0)
    
    265 262
               where ($!) :: forall a b. (a -> b) -> a -> b
    
    263
    +        seq (_ :: t2) (_ :: Integer -> [Integer] -> Integer)
    
    264
    +          where seq :: forall a b. a -> b -> b
    
    266 265
             ($) (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0)
    
    267 266
               where ($) :: forall a b. (a -> b) -> a -> b
    
    268
    -        return (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
    
    269
    -          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    270 267
             pure (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
    
    271 268
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    269
    +        return (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
    
    270
    +          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    271
    +

  • testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr
    1
    -
    
    2 1
     constraint_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    3 2
         • Found hole: _ :: [a] -> a
    
    4 3
           Where: ‘a’ is a rigid type variable bound by
    
    ... ... @@ -42,10 +41,10 @@ constraint_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    42 41
               where ($) :: forall a b. (a -> b) -> a -> b
    
    43 42
             ($!) (_ :: [a] -> a)
    
    44 43
               where ($!) :: forall a b. (a -> b) -> a -> b
    
    45
    -        return (_ :: a)
    
    46
    -          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    47 44
             pure (_ :: a)
    
    48 45
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    46
    +        return (_ :: a)
    
    47
    +          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    49 48
             id (_ :: [a] -> a)
    
    50 49
               where id :: forall a. a -> a
    
    51 50
             head (_ :: [[a] -> a])
    
    ... ... @@ -62,3 +61,4 @@ constraint_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    62 61
               where (!!) :: forall a.
    
    63 62
                             GHC.Internal.Stack.Types.HasCallStack =>
    
    64 63
                             [a] -> Int -> a
    
    64
    +

  • testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr
    1
    -
    
    2 1
     free_monad_hole_fits.hs:14:28: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    3 2
         • Found hole:
    
    4 3
             _a :: (Free f a -> Free f b) -> f (Free f a) -> f (Free f b)
    
    ... ... @@ -55,10 +54,6 @@ free_monad_hole_fits.hs:25:31: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault
    55 54
           Constraints include
    
    56 55
             Applicative f (from free_monad_hole_fits.hs:22:10-40)
    
    57 56
           Valid refinement hole fits include
    
    58
    -        fmap (_ :: a -> b)
    
    59
    -          where fmap :: forall (f :: * -> *) a b.
    
    60
    -                        Functor f =>
    
    61
    -                        (a -> b) -> f a -> f b
    
    62 57
             (<*>) (_ :: Free f (a -> b))
    
    63 58
               where (<*>) :: forall (f :: * -> *) a b.
    
    64 59
                              Applicative f =>
    
    ... ... @@ -67,6 +62,10 @@ free_monad_hole_fits.hs:25:31: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault
    67 62
               where (=<<) :: forall (m :: * -> *) a b.
    
    68 63
                              Monad m =>
    
    69 64
                              (a -> m b) -> m a -> m b
    
    65
    +        fmap (_ :: a -> b)
    
    66
    +          where fmap :: forall (f :: * -> *) a b.
    
    67
    +                        Functor f =>
    
    68
    +                        (a -> b) -> f a -> f b
    
    70 69
             (<$>) (_ :: a -> b)
    
    71 70
               where (<$>) :: forall (f :: * -> *) a b.
    
    72 71
                              Functor f =>
    
    ... ... @@ -75,3 +74,4 @@ free_monad_hole_fits.hs:25:31: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault
    75 74
               where ($) :: forall a b. (a -> b) -> a -> b
    
    76 75
             pure (_ :: Free f b)
    
    77 76
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    77
    +

  • testsuite/tests/typecheck/should_compile/hole_constraints.stderr
    1
    -
    
    2 1
     hole_constraints.hs:8:6: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    3 2
         • Found hole: _ :: a
    
    4 3
           Where: ‘a’ is a rigid type variable bound by
    
    ... ... @@ -67,8 +66,9 @@ hole_constraints.hs:27:32: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    67 66
             foo :: AnyShow -> String (bound at hole_constraints.hs:27:1)
    
    68 67
           Constraints include Show a (from hole_constraints.hs:27:19-27)
    
    69 68
           Valid hole fits include
    
    70
    -        f3 :: forall a. C a => a
    
    71 69
             f1 :: forall a. Eq a => a
    
    72 70
             f2 :: forall a. (Show a, Eq a) => a
    
    71
    +        f3 :: forall a. C a => a
    
    73 72
             [] :: forall a. [a]
    
    74 73
             mempty :: forall a. Monoid a => a
    
    74
    +

  • testsuite/tests/typecheck/should_compile/holes.stderr
    ... ... @@ -40,18 +40,12 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    40 40
             y :: [a] (bound at holes.hs:11:3)
    
    41 41
             z :: [a] -> [a] (bound at holes.hs:11:1)
    
    42 42
           Valid hole fits include
    
    43
    -        y :: [a]
    
    44
    -        z :: [a] -> [a]
    
    45 43
             g :: Int -> Char
    
    46 44
             h :: [Char]
    
    45
    +        y :: [a]
    
    46
    +        z :: [a] -> [a]
    
    47 47
             f :: forall {p}. p
    
    48 48
             otherwise :: Bool
    
    49
    -        False :: Bool
    
    50
    -        True :: Bool
    
    51
    -        LT :: Ordering
    
    52
    -        EQ :: Ordering
    
    53
    -        GT :: Ordering
    
    54
    -        () :: ()
    
    55 49
             (&&) :: Bool -> Bool -> Bool
    
    56 50
             not :: Bool -> Bool
    
    57 51
             (||) :: Bool -> Bool -> Bool
    
    ... ... @@ -74,22 +68,48 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    74 68
             putStrLn :: String -> IO ()
    
    75 69
             readFile :: FilePath -> IO String
    
    76 70
             writeFile :: FilePath -> String -> IO ()
    
    71
    +        EQ :: Ordering
    
    72
    +        GT :: Ordering
    
    73
    +        LT :: Ordering
    
    74
    +        () :: ()
    
    75
    +        False :: Bool
    
    76
    +        True :: Bool
    
    77 77
             (++) :: forall a. [a] -> [a] -> [a]
    
    78
    -        filter :: forall a. (a -> Bool) -> [a] -> [a]
    
    79
    -        fromInteger :: forall a. Num a => Integer -> a
    
    80
    -        (-) :: forall a. Num a => a -> a -> a
    
    81
    -        fromRational :: forall a. Fractional a => Rational -> a
    
    82
    -        negate :: forall a. Num a => a -> a
    
    83
    -        fromIntegral :: forall a b. (Integral a, Num b) => a -> b
    
    84
    -        toInteger :: forall a. Integral a => a -> Integer
    
    85
    -        toRational :: forall a. Real a => a -> Rational
    
    86
    -        (:) :: forall a. a -> [a] -> [a]
    
    87
    -        Nothing :: forall a. Maybe a
    
    88
    -        Just :: forall a. a -> Maybe a
    
    89
    -        [] :: forall a. [a]
    
    90 78
             asTypeOf :: forall a. a -> a -> a
    
    91 79
             id :: forall a. a -> a
    
    92 80
             until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
    
    81
    +        (**) :: forall a. Floating a => a -> a -> a
    
    82
    +        acos :: forall a. Floating a => a -> a
    
    83
    +        acosh :: forall a. Floating a => a -> a
    
    84
    +        asin :: forall a. Floating a => a -> a
    
    85
    +        asinh :: forall a. Floating a => a -> a
    
    86
    +        atan :: forall a. Floating a => a -> a
    
    87
    +        atan2 :: forall a. RealFloat a => a -> a -> a
    
    88
    +        atanh :: forall a. Floating a => a -> a
    
    89
    +        cos :: forall a. Floating a => a -> a
    
    90
    +        cosh :: forall a. Floating a => a -> a
    
    91
    +        decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
    
    92
    +        encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
    
    93
    +        exp :: forall a. Floating a => a -> a
    
    94
    +        exponent :: forall a. RealFloat a => a -> Int
    
    95
    +        floatDigits :: forall a. RealFloat a => a -> Int
    
    96
    +        floatRadix :: forall a. RealFloat a => a -> Integer
    
    97
    +        floatRange :: forall a. RealFloat a => a -> (Int, Int)
    
    98
    +        isDenormalized :: forall a. RealFloat a => a -> Bool
    
    99
    +        isIEEE :: forall a. RealFloat a => a -> Bool
    
    100
    +        isInfinite :: forall a. RealFloat a => a -> Bool
    
    101
    +        isNaN :: forall a. RealFloat a => a -> Bool
    
    102
    +        isNegativeZero :: forall a. RealFloat a => a -> Bool
    
    103
    +        log :: forall a. Floating a => a -> a
    
    104
    +        logBase :: forall a. Floating a => a -> a -> a
    
    105
    +        pi :: forall a. Floating a => a
    
    106
    +        scaleFloat :: forall a. RealFloat a => Int -> a -> a
    
    107
    +        significand :: forall a. RealFloat a => a -> a
    
    108
    +        sin :: forall a. Floating a => a -> a
    
    109
    +        sinh :: forall a. Floating a => a -> a
    
    110
    +        sqrt :: forall a. Floating a => a -> a
    
    111
    +        tan :: forall a. Floating a => a -> a
    
    112
    +        tanh :: forall a. Floating a => a -> a
    
    93 113
             ioError :: forall a.
    
    94 114
                        GHC.Internal.Stack.Types.HasCallStack =>
    
    95 115
                        IOError -> IO a
    
    ... ... @@ -102,6 +122,7 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    102 122
                      [a] -> [a]
    
    103 123
             drop :: forall a. Int -> [a] -> [a]
    
    104 124
             dropWhile :: forall a. (a -> Bool) -> [a] -> [a]
    
    125
    +        filter :: forall a. (a -> Bool) -> [a] -> [a]
    
    105 126
             head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
    
    106 127
             init :: forall a.
    
    107 128
                     GHC.Internal.Stack.Types.HasCallStack =>
    
    ... ... @@ -120,80 +141,57 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    120 141
                     [a] -> [a]
    
    121 142
             take :: forall a. Int -> [a] -> [a]
    
    122 143
             takeWhile :: forall a. (a -> Bool) -> [a] -> [a]
    
    123
    -        subtract :: forall a. Num a => a -> a -> a
    
    124
    -        readParen :: forall a. Bool -> ReadS a -> ReadS a
    
    125
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    126
    -        even :: forall a. Integral a => a -> Bool
    
    127
    -        gcd :: forall a. Integral a => a -> a -> a
    
    128
    -        lcm :: forall a. Integral a => a -> a -> a
    
    129
    -        odd :: forall a. Integral a => a -> Bool
    
    130
    -        (**) :: forall a. Floating a => a -> a -> a
    
    131
    -        acos :: forall a. Floating a => a -> a
    
    132
    -        acosh :: forall a. Floating a => a -> a
    
    133
    -        asin :: forall a. Floating a => a -> a
    
    134
    -        asinh :: forall a. Floating a => a -> a
    
    135
    -        atan :: forall a. Floating a => a -> a
    
    136
    -        atanh :: forall a. Floating a => a -> a
    
    137
    -        cos :: forall a. Floating a => a -> a
    
    138
    -        cosh :: forall a. Floating a => a -> a
    
    139
    -        exp :: forall a. Floating a => a -> a
    
    140
    -        log :: forall a. Floating a => a -> a
    
    141
    -        logBase :: forall a. Floating a => a -> a -> a
    
    142
    -        pi :: forall a. Floating a => a
    
    143
    -        sin :: forall a. Floating a => a -> a
    
    144
    -        sinh :: forall a. Floating a => a -> a
    
    145
    -        sqrt :: forall a. Floating a => a -> a
    
    146
    -        tan :: forall a. Floating a => a -> a
    
    147
    -        tanh :: forall a. Floating a => a -> a
    
    148
    -        atan2 :: forall a. RealFloat a => a -> a -> a
    
    149
    -        decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
    
    150
    -        encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
    
    151
    -        exponent :: forall a. RealFloat a => a -> Int
    
    152
    -        floatDigits :: forall a. RealFloat a => a -> Int
    
    153
    -        floatRadix :: forall a. RealFloat a => a -> Integer
    
    154
    -        floatRange :: forall a. RealFloat a => a -> (Int, Int)
    
    155
    -        isDenormalized :: forall a. RealFloat a => a -> Bool
    
    156
    -        isIEEE :: forall a. RealFloat a => a -> Bool
    
    157
    -        isInfinite :: forall a. RealFloat a => a -> Bool
    
    158
    -        isNaN :: forall a. RealFloat a => a -> Bool
    
    159
    -        isNegativeZero :: forall a. RealFloat a => a -> Bool
    
    160
    -        scaleFloat :: forall a. RealFloat a => Int -> a -> a
    
    161
    -        significand :: forall a. RealFloat a => a -> a
    
    162 144
             (*) :: forall a. Num a => a -> a -> a
    
    163 145
             (+) :: forall a. Num a => a -> a -> a
    
    146
    +        (-) :: forall a. Num a => a -> a -> a
    
    164 147
             abs :: forall a. Num a => a -> a
    
    148
    +        fromInteger :: forall a. Num a => Integer -> a
    
    149
    +        negate :: forall a. Num a => a -> a
    
    165 150
             signum :: forall a. Num a => a -> a
    
    151
    +        subtract :: forall a. Num a => a -> a -> a
    
    152
    +        readParen :: forall a. Bool -> ReadS a -> ReadS a
    
    166 153
             (/) :: forall a. Fractional a => a -> a -> a
    
    167
    -        recip :: forall a. Fractional a => a -> a
    
    154
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    168 155
             div :: forall a. Integral a => a -> a -> a
    
    169 156
             divMod :: forall a. Integral a => a -> a -> (a, a)
    
    157
    +        even :: forall a. Integral a => a -> Bool
    
    158
    +        fromIntegral :: forall a b. (Integral a, Num b) => a -> b
    
    159
    +        fromRational :: forall a. Fractional a => Rational -> a
    
    160
    +        gcd :: forall a. Integral a => a -> a -> a
    
    161
    +        lcm :: forall a. Integral a => a -> a -> a
    
    170 162
             mod :: forall a. Integral a => a -> a -> a
    
    163
    +        odd :: forall a. Integral a => a -> Bool
    
    171 164
             quot :: forall a. Integral a => a -> a -> a
    
    172 165
             quotRem :: forall a. Integral a => a -> a -> (a, a)
    
    166
    +        recip :: forall a. Fractional a => a -> a
    
    173 167
             rem :: forall a. Integral a => a -> a -> a
    
    174
    -        zip :: forall a b. [a] -> [b] -> [(a, b)]
    
    168
    +        toInteger :: forall a. Integral a => a -> Integer
    
    169
    +        toRational :: forall a. Real a => a -> Rational
    
    170
    +        Just :: forall a. a -> Maybe a
    
    171
    +        Nothing :: forall a. Maybe a
    
    172
    +        (:) :: forall a. a -> [a] -> [a]
    
    173
    +        [] :: forall a. [a]
    
    174
    +        const :: forall a b. a -> b -> a
    
    175 175
             map :: forall a b. (a -> b) -> [a] -> [b]
    
    176
    -        realToFrac :: forall a b. (Real a, Fractional b) => a -> b
    
    177 176
             Left :: forall a b. a -> Either a b
    
    178 177
             Right :: forall a b. b -> Either a b
    
    179
    -        (,) :: forall a b. a -> b -> (a, b)
    
    180
    -        const :: forall a b. a -> b -> a
    
    181 178
             maybe :: forall b a. b -> (a -> b) -> Maybe a -> b
    
    182 179
             fst :: forall a b. (a, b) -> a
    
    183 180
             snd :: forall a b. (a, b) -> b
    
    184 181
             scanl :: forall b a. (b -> a -> b) -> b -> [a] -> [b]
    
    185 182
             scanr :: forall a b. (a -> b -> b) -> b -> [a] -> [b]
    
    186 183
             unzip :: forall a b. [(a, b)] -> ([a], [b])
    
    184
    +        zip :: forall a b. [a] -> [b] -> [(a, b)]
    
    187 185
             (^^) :: forall a b. (Fractional a, Integral b) => a -> b -> a
    
    188 186
             ceiling :: forall a b. (RealFrac a, Integral b) => a -> b
    
    189 187
             floor :: forall a b. (RealFrac a, Integral b) => a -> b
    
    190 188
             properFraction :: forall a b.
    
    191 189
                               (RealFrac a, Integral b) =>
    
    192 190
                               a -> (b, a)
    
    191
    +        realToFrac :: forall a b. (Real a, Fractional b) => a -> b
    
    193 192
             round :: forall a b. (RealFrac a, Integral b) => a -> b
    
    194 193
             truncate :: forall a b. (RealFrac a, Integral b) => a -> b
    
    195
    -        seq :: forall a b. a -> b -> b
    
    196
    -        (,,) :: forall a b c. a -> b -> c -> (a, b, c)
    
    194
    +        (,) :: forall a b. a -> b -> (a, b)
    
    197 195
             ($!) :: forall a b. (a -> b) -> a -> b
    
    198 196
             (.) :: forall b c a. (b -> c) -> (a -> b) -> a -> c
    
    199 197
             either :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
    
    ... ... @@ -202,11 +200,13 @@ holes.hs:11:15: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    202 200
             unzip3 :: forall a b c. [(a, b, c)] -> ([a], [b], [c])
    
    203 201
             zip3 :: forall a b c. [a] -> [b] -> [c] -> [(a, b, c)]
    
    204 202
             zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
    
    203
    +        seq :: forall a b. a -> b -> b
    
    204
    +        (,,) :: forall a b c. a -> b -> c -> (a, b, c)
    
    205 205
             ($) :: forall a b. (a -> b) -> a -> b
    
    206
    -        (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
    
    207 206
             flip :: forall a b c. (a -> b -> c) -> b -> a -> c
    
    208 207
             zipWith3 :: forall a b c d.
    
    209 208
                         (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
    
    209
    +        (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
    
    210 210
             (,,,,) :: forall a b c d e.
    
    211 211
                       a -> b -> c -> d -> e -> (a, b, c, d, e)
    
    212 212
             (,,,,,) :: forall a b c d e f.
    

  • testsuite/tests/typecheck/should_compile/holes2.stderr
    1
    -
    
    2 1
     holes2.hs:3:5: warning: [GHC-39999] [-Wdeferred-type-errors (in -Wdefault)]
    
    3 2
         • Ambiguous type variable ‘a0’ arising from a use of ‘show’
    
    4 3
           prevents the constraint ‘(Show a0)’ from being solved.
    
    ... ... @@ -8,7 +7,7 @@ holes2.hs:3:5: warning: [GHC-39999] [-Wdeferred-type-errors (in -Wdefault)]
    8 7
               -- Defined in ‘GHC.Internal.Data.Either’
    
    9 8
             instance Show Ordering -- Defined in ‘GHC.Internal.Show’
    
    10 9
             ...plus 26 others
    
    11
    -        ...plus 48 instances involving out-of-scope types
    
    10
    +        ...plus 49 instances involving out-of-scope types
    
    12 11
             (use -fprint-potential-instances to see them all)
    
    13 12
         • In the expression: show _
    
    14 13
           In an equation for ‘f’: f = show _
    
    ... ... @@ -23,10 +22,11 @@ holes2.hs:3:10: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    23 22
           Valid hole fits include
    
    24 23
             f :: String
    
    25 24
             otherwise :: Bool
    
    26
    -        False :: Bool
    
    27
    -        True :: Bool
    
    28
    -        LT :: Ordering
    
    29 25
             EQ :: Ordering
    
    30 26
             GT :: Ordering
    
    27
    +        LT :: Ordering
    
    31 28
             () :: ()
    
    29
    +        False :: Bool
    
    30
    +        True :: Bool
    
    32 31
             pi :: forall a. Floating a => a
    
    32
    +

  • testsuite/tests/typecheck/should_compile/holes3.stderr
    ... ... @@ -43,18 +43,12 @@ holes3.hs:11:15: error: [GHC-88464]
    43 43
             y :: [a] (bound at holes3.hs:11:3)
    
    44 44
             z :: [a] -> [a] (bound at holes3.hs:11:1)
    
    45 45
           Valid hole fits include
    
    46
    -        y :: [a]
    
    47
    -        z :: [a] -> [a]
    
    48 46
             g :: Int -> Char
    
    49 47
             h :: [Char]
    
    48
    +        y :: [a]
    
    49
    +        z :: [a] -> [a]
    
    50 50
             f :: forall {p}. p
    
    51 51
             otherwise :: Bool
    
    52
    -        False :: Bool
    
    53
    -        True :: Bool
    
    54
    -        LT :: Ordering
    
    55
    -        EQ :: Ordering
    
    56
    -        GT :: Ordering
    
    57
    -        () :: ()
    
    58 52
             (&&) :: Bool -> Bool -> Bool
    
    59 53
             not :: Bool -> Bool
    
    60 54
             (||) :: Bool -> Bool -> Bool
    
    ... ... @@ -77,22 +71,48 @@ holes3.hs:11:15: error: [GHC-88464]
    77 71
             putStrLn :: String -> IO ()
    
    78 72
             readFile :: FilePath -> IO String
    
    79 73
             writeFile :: FilePath -> String -> IO ()
    
    74
    +        EQ :: Ordering
    
    75
    +        GT :: Ordering
    
    76
    +        LT :: Ordering
    
    77
    +        () :: ()
    
    78
    +        False :: Bool
    
    79
    +        True :: Bool
    
    80 80
             (++) :: forall a. [a] -> [a] -> [a]
    
    81
    -        filter :: forall a. (a -> Bool) -> [a] -> [a]
    
    82
    -        fromInteger :: forall a. Num a => Integer -> a
    
    83
    -        (-) :: forall a. Num a => a -> a -> a
    
    84
    -        fromRational :: forall a. Fractional a => Rational -> a
    
    85
    -        negate :: forall a. Num a => a -> a
    
    86
    -        fromIntegral :: forall a b. (Integral a, Num b) => a -> b
    
    87
    -        toInteger :: forall a. Integral a => a -> Integer
    
    88
    -        toRational :: forall a. Real a => a -> Rational
    
    89
    -        (:) :: forall a. a -> [a] -> [a]
    
    90
    -        Nothing :: forall a. Maybe a
    
    91
    -        Just :: forall a. a -> Maybe a
    
    92
    -        [] :: forall a. [a]
    
    93 81
             asTypeOf :: forall a. a -> a -> a
    
    94 82
             id :: forall a. a -> a
    
    95 83
             until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
    
    84
    +        (**) :: forall a. Floating a => a -> a -> a
    
    85
    +        acos :: forall a. Floating a => a -> a
    
    86
    +        acosh :: forall a. Floating a => a -> a
    
    87
    +        asin :: forall a. Floating a => a -> a
    
    88
    +        asinh :: forall a. Floating a => a -> a
    
    89
    +        atan :: forall a. Floating a => a -> a
    
    90
    +        atan2 :: forall a. RealFloat a => a -> a -> a
    
    91
    +        atanh :: forall a. Floating a => a -> a
    
    92
    +        cos :: forall a. Floating a => a -> a
    
    93
    +        cosh :: forall a. Floating a => a -> a
    
    94
    +        decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
    
    95
    +        encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
    
    96
    +        exp :: forall a. Floating a => a -> a
    
    97
    +        exponent :: forall a. RealFloat a => a -> Int
    
    98
    +        floatDigits :: forall a. RealFloat a => a -> Int
    
    99
    +        floatRadix :: forall a. RealFloat a => a -> Integer
    
    100
    +        floatRange :: forall a. RealFloat a => a -> (Int, Int)
    
    101
    +        isDenormalized :: forall a. RealFloat a => a -> Bool
    
    102
    +        isIEEE :: forall a. RealFloat a => a -> Bool
    
    103
    +        isInfinite :: forall a. RealFloat a => a -> Bool
    
    104
    +        isNaN :: forall a. RealFloat a => a -> Bool
    
    105
    +        isNegativeZero :: forall a. RealFloat a => a -> Bool
    
    106
    +        log :: forall a. Floating a => a -> a
    
    107
    +        logBase :: forall a. Floating a => a -> a -> a
    
    108
    +        pi :: forall a. Floating a => a
    
    109
    +        scaleFloat :: forall a. RealFloat a => Int -> a -> a
    
    110
    +        significand :: forall a. RealFloat a => a -> a
    
    111
    +        sin :: forall a. Floating a => a -> a
    
    112
    +        sinh :: forall a. Floating a => a -> a
    
    113
    +        sqrt :: forall a. Floating a => a -> a
    
    114
    +        tan :: forall a. Floating a => a -> a
    
    115
    +        tanh :: forall a. Floating a => a -> a
    
    96 116
             ioError :: forall a.
    
    97 117
                        GHC.Internal.Stack.Types.HasCallStack =>
    
    98 118
                        IOError -> IO a
    
    ... ... @@ -105,6 +125,7 @@ holes3.hs:11:15: error: [GHC-88464]
    105 125
                      [a] -> [a]
    
    106 126
             drop :: forall a. Int -> [a] -> [a]
    
    107 127
             dropWhile :: forall a. (a -> Bool) -> [a] -> [a]
    
    128
    +        filter :: forall a. (a -> Bool) -> [a] -> [a]
    
    108 129
             head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
    
    109 130
             init :: forall a.
    
    110 131
                     GHC.Internal.Stack.Types.HasCallStack =>
    
    ... ... @@ -123,80 +144,57 @@ holes3.hs:11:15: error: [GHC-88464]
    123 144
                     [a] -> [a]
    
    124 145
             take :: forall a. Int -> [a] -> [a]
    
    125 146
             takeWhile :: forall a. (a -> Bool) -> [a] -> [a]
    
    126
    -        subtract :: forall a. Num a => a -> a -> a
    
    127
    -        readParen :: forall a. Bool -> ReadS a -> ReadS a
    
    128
    -        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    129
    -        even :: forall a. Integral a => a -> Bool
    
    130
    -        gcd :: forall a. Integral a => a -> a -> a
    
    131
    -        lcm :: forall a. Integral a => a -> a -> a
    
    132
    -        odd :: forall a. Integral a => a -> Bool
    
    133
    -        (**) :: forall a. Floating a => a -> a -> a
    
    134
    -        acos :: forall a. Floating a => a -> a
    
    135
    -        acosh :: forall a. Floating a => a -> a
    
    136
    -        asin :: forall a. Floating a => a -> a
    
    137
    -        asinh :: forall a. Floating a => a -> a
    
    138
    -        atan :: forall a. Floating a => a -> a
    
    139
    -        atanh :: forall a. Floating a => a -> a
    
    140
    -        cos :: forall a. Floating a => a -> a
    
    141
    -        cosh :: forall a. Floating a => a -> a
    
    142
    -        exp :: forall a. Floating a => a -> a
    
    143
    -        log :: forall a. Floating a => a -> a
    
    144
    -        logBase :: forall a. Floating a => a -> a -> a
    
    145
    -        pi :: forall a. Floating a => a
    
    146
    -        sin :: forall a. Floating a => a -> a
    
    147
    -        sinh :: forall a. Floating a => a -> a
    
    148
    -        sqrt :: forall a. Floating a => a -> a
    
    149
    -        tan :: forall a. Floating a => a -> a
    
    150
    -        tanh :: forall a. Floating a => a -> a
    
    151
    -        atan2 :: forall a. RealFloat a => a -> a -> a
    
    152
    -        decodeFloat :: forall a. RealFloat a => a -> (Integer, Int)
    
    153
    -        encodeFloat :: forall a. RealFloat a => Integer -> Int -> a
    
    154
    -        exponent :: forall a. RealFloat a => a -> Int
    
    155
    -        floatDigits :: forall a. RealFloat a => a -> Int
    
    156
    -        floatRadix :: forall a. RealFloat a => a -> Integer
    
    157
    -        floatRange :: forall a. RealFloat a => a -> (Int, Int)
    
    158
    -        isDenormalized :: forall a. RealFloat a => a -> Bool
    
    159
    -        isIEEE :: forall a. RealFloat a => a -> Bool
    
    160
    -        isInfinite :: forall a. RealFloat a => a -> Bool
    
    161
    -        isNaN :: forall a. RealFloat a => a -> Bool
    
    162
    -        isNegativeZero :: forall a. RealFloat a => a -> Bool
    
    163
    -        scaleFloat :: forall a. RealFloat a => Int -> a -> a
    
    164
    -        significand :: forall a. RealFloat a => a -> a
    
    165 147
             (*) :: forall a. Num a => a -> a -> a
    
    166 148
             (+) :: forall a. Num a => a -> a -> a
    
    149
    +        (-) :: forall a. Num a => a -> a -> a
    
    167 150
             abs :: forall a. Num a => a -> a
    
    151
    +        fromInteger :: forall a. Num a => Integer -> a
    
    152
    +        negate :: forall a. Num a => a -> a
    
    168 153
             signum :: forall a. Num a => a -> a
    
    154
    +        subtract :: forall a. Num a => a -> a -> a
    
    155
    +        readParen :: forall a. Bool -> ReadS a -> ReadS a
    
    169 156
             (/) :: forall a. Fractional a => a -> a -> a
    
    170
    -        recip :: forall a. Fractional a => a -> a
    
    157
    +        (^) :: forall a b. (Num a, Integral b) => a -> b -> a
    
    171 158
             div :: forall a. Integral a => a -> a -> a
    
    172 159
             divMod :: forall a. Integral a => a -> a -> (a, a)
    
    160
    +        even :: forall a. Integral a => a -> Bool
    
    161
    +        fromIntegral :: forall a b. (Integral a, Num b) => a -> b
    
    162
    +        fromRational :: forall a. Fractional a => Rational -> a
    
    163
    +        gcd :: forall a. Integral a => a -> a -> a
    
    164
    +        lcm :: forall a. Integral a => a -> a -> a
    
    173 165
             mod :: forall a. Integral a => a -> a -> a
    
    166
    +        odd :: forall a. Integral a => a -> Bool
    
    174 167
             quot :: forall a. Integral a => a -> a -> a
    
    175 168
             quotRem :: forall a. Integral a => a -> a -> (a, a)
    
    169
    +        recip :: forall a. Fractional a => a -> a
    
    176 170
             rem :: forall a. Integral a => a -> a -> a
    
    177
    -        zip :: forall a b. [a] -> [b] -> [(a, b)]
    
    171
    +        toInteger :: forall a. Integral a => a -> Integer
    
    172
    +        toRational :: forall a. Real a => a -> Rational
    
    173
    +        Just :: forall a. a -> Maybe a
    
    174
    +        Nothing :: forall a. Maybe a
    
    175
    +        (:) :: forall a. a -> [a] -> [a]
    
    176
    +        [] :: forall a. [a]
    
    177
    +        const :: forall a b. a -> b -> a
    
    178 178
             map :: forall a b. (a -> b) -> [a] -> [b]
    
    179
    -        realToFrac :: forall a b. (Real a, Fractional b) => a -> b
    
    180 179
             Left :: forall a b. a -> Either a b
    
    181 180
             Right :: forall a b. b -> Either a b
    
    182
    -        (,) :: forall a b. a -> b -> (a, b)
    
    183
    -        const :: forall a b. a -> b -> a
    
    184 181
             maybe :: forall b a. b -> (a -> b) -> Maybe a -> b
    
    185 182
             fst :: forall a b. (a, b) -> a
    
    186 183
             snd :: forall a b. (a, b) -> b
    
    187 184
             scanl :: forall b a. (b -> a -> b) -> b -> [a] -> [b]
    
    188 185
             scanr :: forall a b. (a -> b -> b) -> b -> [a] -> [b]
    
    189 186
             unzip :: forall a b. [(a, b)] -> ([a], [b])
    
    187
    +        zip :: forall a b. [a] -> [b] -> [(a, b)]
    
    190 188
             (^^) :: forall a b. (Fractional a, Integral b) => a -> b -> a
    
    191 189
             ceiling :: forall a b. (RealFrac a, Integral b) => a -> b
    
    192 190
             floor :: forall a b. (RealFrac a, Integral b) => a -> b
    
    193 191
             properFraction :: forall a b.
    
    194 192
                               (RealFrac a, Integral b) =>
    
    195 193
                               a -> (b, a)
    
    194
    +        realToFrac :: forall a b. (Real a, Fractional b) => a -> b
    
    196 195
             round :: forall a b. (RealFrac a, Integral b) => a -> b
    
    197 196
             truncate :: forall a b. (RealFrac a, Integral b) => a -> b
    
    198
    -        seq :: forall a b. a -> b -> b
    
    199
    -        (,,) :: forall a b c. a -> b -> c -> (a, b, c)
    
    197
    +        (,) :: forall a b. a -> b -> (a, b)
    
    200 198
             ($!) :: forall a b. (a -> b) -> a -> b
    
    201 199
             (.) :: forall b c a. (b -> c) -> (a -> b) -> a -> c
    
    202 200
             either :: forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
    
    ... ... @@ -205,11 +203,13 @@ holes3.hs:11:15: error: [GHC-88464]
    205 203
             unzip3 :: forall a b c. [(a, b, c)] -> ([a], [b], [c])
    
    206 204
             zip3 :: forall a b c. [a] -> [b] -> [c] -> [(a, b, c)]
    
    207 205
             zipWith :: forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
    
    206
    +        seq :: forall a b. a -> b -> b
    
    207
    +        (,,) :: forall a b c. a -> b -> c -> (a, b, c)
    
    208 208
             ($) :: forall a b. (a -> b) -> a -> b
    
    209
    -        (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
    
    210 209
             flip :: forall a b c. (a -> b -> c) -> b -> a -> c
    
    211 210
             zipWith3 :: forall a b c d.
    
    212 211
                         (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
    
    212
    +        (,,,) :: forall a b c d. a -> b -> c -> d -> (a, b, c, d)
    
    213 213
             (,,,,) :: forall a b c d e.
    
    214 214
                       a -> b -> c -> d -> e -> (a, b, c, d, e)
    
    215 215
             (,,,,,) :: forall a b c d e f.
    

  • testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr
    ... ... @@ -4,8 +4,8 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    4 4
         • Relevant bindings include
    
    5 5
             f :: [Integer] -> Integer (bound at refinement_hole_fits.hs:4:1)
    
    6 6
           Valid hole fits include
    
    7
    -        f :: [Integer] -> Integer (bound at refinement_hole_fits.hs:4:1)
    
    8 7
             g :: [Integer] -> Integer (bound at refinement_hole_fits.hs:7:1)
    
    8
    +        f :: [Integer] -> Integer (bound at refinement_hole_fits.hs:4:1)
    
    9 9
             head :: forall a. GHC.Internal.Stack.Types.HasCallStack => [a] -> a
    
    10 10
               with head @Integer
    
    11 11
               (imported from ‘Prelude’
    
    ... ... @@ -15,19 +15,19 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    15 15
               (imported from ‘Prelude’
    
    16 16
                (and originally defined in ‘GHC.Internal.List’))
    
    17 17
             maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
    
    18
    -          with maximum @[] @Integer
    
    18
    +          with maximum @[]
    
    19 19
               (imported from ‘Prelude’
    
    20 20
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    21 21
             minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
    
    22
    -          with minimum @[] @Integer
    
    22
    +          with minimum @[]
    
    23 23
               (imported from ‘Prelude’
    
    24 24
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    25 25
             product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
    
    26
    -          with product @[] @Integer
    
    26
    +          with product @[]
    
    27 27
               (imported from ‘Prelude’
    
    28 28
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    29 29
             sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
    
    30
    -          with sum @[] @Integer
    
    30
    +          with sum @[]
    
    31 31
               (imported from ‘Prelude’
    
    32 32
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    33 33
           Valid refinement hole fits include
    
    ... ... @@ -35,35 +35,35 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    35 35
               where foldl1 :: forall (t :: * -> *) a.
    
    36 36
                               Foldable t =>
    
    37 37
                               (a -> a -> a) -> t a -> a
    
    38
    -          with foldl1 @[] @Integer
    
    38
    +          with foldl1 @[]
    
    39 39
               (imported from ‘Prelude’
    
    40 40
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    41 41
             foldr1 (_ :: Integer -> Integer -> Integer)
    
    42 42
               where foldr1 :: forall (t :: * -> *) a.
    
    43 43
                               Foldable t =>
    
    44 44
                               (a -> a -> a) -> t a -> a
    
    45
    -          with foldr1 @[] @Integer
    
    45
    +          with foldr1 @[]
    
    46 46
               (imported from ‘Prelude’
    
    47 47
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    48 48
             foldl (_ :: Integer -> Integer -> Integer) (_ :: Integer)
    
    49 49
               where foldl :: forall (t :: * -> *) b a.
    
    50 50
                              Foldable t =>
    
    51 51
                              (b -> a -> b) -> b -> t a -> b
    
    52
    -          with foldl @[] @Integer @Integer
    
    52
    +          with foldl @[]
    
    53 53
               (imported from ‘Prelude’
    
    54 54
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    55 55
             foldl' (_ :: Integer -> Integer -> Integer) (_ :: Integer)
    
    56 56
               where foldl' :: forall (t :: * -> *) b a.
    
    57 57
                               Foldable t =>
    
    58 58
                               (b -> a -> b) -> b -> t a -> b
    
    59
    -          with foldl' @[] @Integer @Integer
    
    59
    +          with foldl' @[]
    
    60 60
               (imported from ‘Prelude’
    
    61 61
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    62 62
             foldr (_ :: Integer -> Integer -> Integer) (_ :: Integer)
    
    63 63
               where foldr :: forall (t :: * -> *) a b.
    
    64 64
                              Foldable t =>
    
    65 65
                              (a -> b -> b) -> b -> t a -> b
    
    66
    -          with foldr @[] @Integer @Integer
    
    66
    +          with foldr @[]
    
    67 67
               (imported from ‘Prelude’
    
    68 68
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    69 69
             const (_ :: Integer)
    
    ... ... @@ -84,14 +84,14 @@ refinement_hole_fits.hs:4:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    84 84
               with ($!) @GHC.Internal.Types.LiftedRep @[Integer] @Integer
    
    85 85
               (imported from ‘Prelude’
    
    86 86
                (and originally defined in ‘GHC.Internal.Base’))
    
    87
    -        return (_ :: Integer)
    
    88
    -          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    89
    -          with return @((->) [Integer]) @Integer
    
    90
    -          (imported from ‘Prelude’
    
    91
    -           (and originally defined in ‘GHC.Internal.Base’))
    
    92 87
             pure (_ :: Integer)
    
    93 88
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    94
    -          with pure @((->) [Integer]) @Integer
    
    89
    +          with pure @((->) [Integer])
    
    90
    +          (imported from ‘Prelude’
    
    91
    +           (and originally defined in ‘GHC.Internal.Base’))
    
    92
    +        return (_ :: Integer)
    
    93
    +          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    94
    +          with return @((->) [Integer])
    
    95 95
               (imported from ‘Prelude’
    
    96 96
                (and originally defined in ‘GHC.Internal.Base’))
    
    97 97
             j (_ :: [Integer] -> Integer)
    
    ... ... @@ -141,12 +141,12 @@ refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    141 141
               with const @Integer @[Integer]
    
    142 142
               (imported from ‘Prelude’
    
    143 143
                (and originally defined in ‘GHC.Internal.Base’))
    
    144
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    145
    -          with return @((->) [Integer]) @Integer
    
    144
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    145
    +          with pure @((->) [Integer])
    
    146 146
               (imported from ‘Prelude’
    
    147 147
                (and originally defined in ‘GHC.Internal.Base’))
    
    148
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    149
    -          with pure @((->) [Integer]) @Integer
    
    148
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    149
    +          with return @((->) [Integer])
    
    150 150
               (imported from ‘Prelude’
    
    151 151
                (and originally defined in ‘GHC.Internal.Base’))
    
    152 152
           Valid refinement hole fits include
    
    ... ... @@ -154,21 +154,21 @@ refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    154 154
               where foldl :: forall (t :: * -> *) b a.
    
    155 155
                              Foldable t =>
    
    156 156
                              (b -> a -> b) -> b -> t a -> b
    
    157
    -          with foldl @[] @Integer @Integer
    
    157
    +          with foldl @[]
    
    158 158
               (imported from ‘Prelude’
    
    159 159
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    160 160
             foldl' (_ :: Integer -> Integer -> Integer)
    
    161 161
               where foldl' :: forall (t :: * -> *) b a.
    
    162 162
                               Foldable t =>
    
    163 163
                               (b -> a -> b) -> b -> t a -> b
    
    164
    -          with foldl' @[] @Integer @Integer
    
    164
    +          with foldl' @[]
    
    165 165
               (imported from ‘Prelude’
    
    166 166
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    167 167
             foldr (_ :: Integer -> Integer -> Integer)
    
    168 168
               where foldr :: forall (t :: * -> *) a b.
    
    169 169
                              Foldable t =>
    
    170 170
                              (a -> b -> b) -> b -> t a -> b
    
    171
    -          with foldr @[] @Integer @Integer
    
    171
    +          with foldr @[]
    
    172 172
               (imported from ‘Prelude’
    
    173 173
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    174 174
             curry (_ :: (Integer, [Integer]) -> Integer)
    
    ... ... @@ -204,14 +204,14 @@ refinement_hole_fits.hs:7:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    204 204
                         @([Integer] -> Integer)
    
    205 205
               (imported from ‘Prelude’
    
    206 206
                (and originally defined in ‘GHC.Internal.Base’))
    
    207
    -        return (_ :: [Integer] -> Integer)
    
    208
    -          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    209
    -          with return @((->) Integer) @([Integer] -> Integer)
    
    210
    -          (imported from ‘Prelude’
    
    211
    -           (and originally defined in ‘GHC.Internal.Base’))
    
    212 207
             pure (_ :: [Integer] -> Integer)
    
    213 208
               where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    214
    -          with pure @((->) Integer) @([Integer] -> Integer)
    
    209
    +          with pure @((->) Integer)
    
    210
    +          (imported from ‘Prelude’
    
    211
    +           (and originally defined in ‘GHC.Internal.Base’))
    
    212
    +        return (_ :: [Integer] -> Integer)
    
    213
    +          where return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    214
    +          with return @((->) Integer)
    
    215 215
               (imported from ‘Prelude’
    
    216 216
                (and originally defined in ‘GHC.Internal.Base’))
    
    217 217
             j (_ :: Integer -> [Integer] -> Integer)
    

  • testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr
    ... ... @@ -26,15 +26,15 @@ subsumption_sort_hole_fits.hs:2:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdef
    26 26
             fail :: forall (m :: * -> *) a.
    
    27 27
                     (MonadFail m, GHC.Internal.Stack.Types.HasCallStack) =>
    
    28 28
                     String -> m a
    
    29
    -          with fail @[] @String
    
    29
    +          with fail @[]
    
    30 30
               (imported from ‘Prelude’
    
    31 31
                (and originally defined in ‘GHC.Internal.Control.Monad.Fail’))
    
    32 32
             return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    33
    -          with return @[] @String
    
    33
    +          with return @[]
    
    34 34
               (imported from ‘Prelude’
    
    35 35
                (and originally defined in ‘GHC.Internal.Base’))
    
    36 36
             pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    37
    -          with pure @[] @String
    
    37
    +          with pure @[]
    
    38 38
               (imported from ‘Prelude’
    
    39 39
                (and originally defined in ‘GHC.Internal.Base’))
    
    40 40
     

  • testsuite/tests/typecheck/should_compile/type_in_type_hole_fits.stderr
    1
    -
    
    2 1
     type_in_type_hole_fits.hs:79:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    3 2
         • Found hole:
    
    4 3
             _a :: [Integer] -> Sorted (O (NLogN 2 0)) (O N) True Integer
    
    ... ... @@ -14,18 +13,18 @@ type_in_type_hole_fits.hs:79:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefau
    14 13
                       [a] -> Sorted cpu mem stable a
    
    15 14
               with Sorted @(O (NLogN 2 0)) @(O N) @True @Integer
    
    16 15
               (defined at type_in_type_hole_fits.hs:54:18)
    
    17
    -        mergeSort :: forall a (n :: AsympPoly) (m :: AsympPoly)
    
    18
    -                            (s :: Bool).
    
    19
    -                     (Ord a, n >=. O (N *. LogN), m >=. O N, IsStable s) =>
    
    20
    -                     [a] -> Sorted n m s a
    
    21
    -          with mergeSort @Integer @(O (NLogN 2 0)) @(O N) @True
    
    22
    -          (defined at type_in_type_hole_fits.hs:61:1)
    
    23 16
             insertionSort :: forall a (n :: AsympPoly) (m :: AsympPoly)
    
    24 17
                                     (s :: Bool).
    
    25 18
                              (Ord a, n >=. O (N ^. 2), m >=. O One, IsStable s) =>
    
    26 19
                              [a] -> Sorted n m s a
    
    27 20
               with insertionSort @Integer @(O (NLogN 2 0)) @(O N) @True
    
    28 21
               (defined at type_in_type_hole_fits.hs:65:1)
    
    22
    +        mergeSort :: forall a (n :: AsympPoly) (m :: AsympPoly)
    
    23
    +                            (s :: Bool).
    
    24
    +                     (Ord a, n >=. O (N *. LogN), m >=. O N, IsStable s) =>
    
    25
    +                     [a] -> Sorted n m s a
    
    26
    +          with mergeSort @Integer @(O (NLogN 2 0)) @(O N) @True
    
    27
    +          (defined at type_in_type_hole_fits.hs:61:1)
    
    29 28
     
    
    30 29
     type_in_type_hole_fits.hs:82:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    31 30
         • Found hole:
    
    ... ... @@ -37,16 +36,16 @@ type_in_type_hole_fits.hs:82:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefau
    37 36
             mySortB :: Sorted (O (N *. LogN)) (O N) False Integer
    
    38 37
               (bound at type_in_type_hole_fits.hs:82:1)
    
    39 38
           Valid hole fits include
    
    40
    -        quickSort :: forall a (n :: AsympPoly) (m :: AsympPoly).
    
    41
    -                     (Ord a, n >=. O (N *. LogN), m >=. O N) =>
    
    42
    -                     [a] -> Sorted n m False a
    
    43
    -          with quickSort @Integer @(O (NLogN 1 1)) @(O N)
    
    44
    -          (defined at type_in_type_hole_fits.hs:71:1)
    
    45 39
             heapSort :: forall a (n :: AsympPoly) (m :: AsympPoly).
    
    46 40
                         (Ord a, n >=. O (N *. LogN), m >=. O One) =>
    
    47 41
                         [a] -> Sorted n m False a
    
    48 42
               with heapSort @Integer @(O (NLogN 1 1)) @(O N)
    
    49 43
               (defined at type_in_type_hole_fits.hs:74:1)
    
    44
    +        quickSort :: forall a (n :: AsympPoly) (m :: AsympPoly).
    
    45
    +                     (Ord a, n >=. O (N *. LogN), m >=. O N) =>
    
    46
    +                     [a] -> Sorted n m False a
    
    47
    +          with quickSort @Integer @(O (NLogN 1 1)) @(O N)
    
    48
    +          (defined at type_in_type_hole_fits.hs:71:1)
    
    50 49
             Sorted :: forall (cpu :: AsympPoly) (mem :: AsympPoly)
    
    51 50
                              (stable :: Bool) a.
    
    52 51
                       [a] -> Sorted cpu mem stable a
    
    ... ... @@ -79,3 +78,4 @@ type_in_type_hole_fits.hs:85:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefau
    79 78
                       [a] -> Sorted cpu mem stable a
    
    80 79
               with Sorted @(O (NLogN 1 1)) @(O One) @False @Integer
    
    81 80
               (defined at type_in_type_hole_fits.hs:54:18)
    
    81
    +

  • testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
    ... ... @@ -25,15 +25,15 @@ valid_hole_fits.hs:17:17: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    25 25
             x :: Int (bound at valid_hole_fits.hs:16:12)
    
    26 26
             c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1)
    
    27 27
           Valid hole fits include
    
    28
    -        c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1)
    
    29 28
             a :: Int -> IO Int (bound at valid_hole_fits.hs:12:1)
    
    30 29
             b :: Int -> IO Int (bound at valid_hole_fits.hs:14:1)
    
    31
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    32
    -          with return @IO @Int
    
    30
    +        c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1)
    
    31
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    32
    +          with pure @IO
    
    33 33
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    34 34
                (and originally defined in ‘GHC.Internal.Base’))
    
    35
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    36
    -          with pure @IO @Int
    
    35
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    36
    +          with return @IO
    
    37 37
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    38 38
                (and originally defined in ‘GHC.Internal.Base’))
    
    39 39
     
    
    ... ... @@ -82,12 +82,12 @@ valid_hole_fits.hs:27:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    82 82
               with Just @Integer
    
    83 83
               (imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17
    
    84 84
                (and originally defined in ‘GHC.Internal.Maybe’))
    
    85
    -        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    86
    -          with return @Maybe @Integer
    
    85
    +        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    86
    +          with pure @Maybe
    
    87 87
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    88 88
                (and originally defined in ‘GHC.Internal.Base’))
    
    89
    -        pure :: forall (f :: * -> *) a. Applicative f => a -> f a
    
    90
    -          with pure @Maybe @Integer
    
    89
    +        return :: forall (m :: * -> *) a. Monad m => a -> m a
    
    90
    +          with return @Maybe
    
    91 91
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    92 92
                (and originally defined in ‘GHC.Internal.Base’))
    
    93 93
     
    
    ... ... @@ -100,28 +100,28 @@ valid_hole_fits.hs:30:10: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    100 100
         • Relevant bindings include
    
    101 101
             f :: String (bound at valid_hole_fits.hs:30:1)
    
    102 102
           Valid hole fits include
    
    103
    -        f :: String (bound at valid_hole_fits.hs:30:1)
    
    104
    -        k :: Maybe Integer (defined at valid_hole_fits.hs:27:1)
    
    105 103
             h :: String (bound at valid_hole_fits.hs:34:1)
    
    104
    +        k :: Maybe Integer (defined at valid_hole_fits.hs:27:1)
    
    105
    +        f :: String (bound at valid_hole_fits.hs:30:1)
    
    106 106
             otherwise :: Bool
    
    107 107
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    108 108
                (and originally defined in ‘GHC.Internal.Base’))
    
    109
    -        False :: Bool
    
    109
    +        EQ :: Ordering
    
    110 110
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    111 111
                (and originally defined in ‘GHC.Internal.Types’))
    
    112
    -        True :: Bool
    
    112
    +        GT :: Ordering
    
    113 113
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    114 114
                (and originally defined in ‘GHC.Internal.Types’))
    
    115 115
             LT :: Ordering
    
    116 116
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    117 117
                (and originally defined in ‘GHC.Internal.Types’))
    
    118
    -        EQ :: Ordering
    
    118
    +        () :: () (bound at <wired into compiler>)
    
    119
    +        False :: Bool
    
    119 120
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    120 121
                (and originally defined in ‘GHC.Internal.Types’))
    
    121
    -        GT :: Ordering
    
    122
    +        True :: Bool
    
    122 123
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    123 124
                (and originally defined in ‘GHC.Internal.Types’))
    
    124
    -        () :: () (bound at <wired into compiler>)
    
    125 125
             pi :: forall a. Floating a => a
    
    126 126
               with pi @Double
    
    127 127
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    ... ... @@ -139,22 +139,14 @@ valid_hole_fits.hs:34:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    139 139
             not :: Bool -> Bool
    
    140 140
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    141 141
                (and originally defined in ‘GHC.Internal.Classes’))
    
    142
    -        enumFrom :: forall a. Enum a => a -> [a]
    
    143
    -          with enumFrom @Bool
    
    144
    -          (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    145
    -           (and originally defined in ‘GHC.Internal.Enum’))
    
    146
    -        Just :: forall a. a -> Maybe a
    
    147
    -          with Just @Bool
    
    148
    -          (imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17
    
    149
    -           (and originally defined in ‘GHC.Internal.Maybe’))
    
    150 142
             id :: forall a. a -> a
    
    151 143
               with id @Bool
    
    152 144
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    153 145
                (and originally defined in ‘GHC.Internal.Base’))
    
    154
    -        repeat :: forall a. a -> [a]
    
    155
    -          with repeat @Bool
    
    146
    +        enumFrom :: forall a. Enum a => a -> [a]
    
    147
    +          with enumFrom @Bool
    
    156 148
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    157
    -           (and originally defined in ‘GHC.Internal.List’))
    
    149
    +           (and originally defined in ‘GHC.Internal.Enum’))
    
    158 150
             fromEnum :: forall a. Enum a => a -> Int
    
    159 151
               with fromEnum @Bool
    
    160 152
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    ... ... @@ -167,10 +159,18 @@ valid_hole_fits.hs:34:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    167 159
               with succ @Bool
    
    168 160
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    169 161
                (and originally defined in ‘GHC.Internal.Enum’))
    
    162
    +        repeat :: forall a. a -> [a]
    
    163
    +          with repeat @Bool
    
    164
    +          (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    165
    +           (and originally defined in ‘GHC.Internal.List’))
    
    170 166
             show :: forall a. Show a => a -> String
    
    171 167
               with show @Bool
    
    172 168
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    173 169
                (and originally defined in ‘GHC.Internal.Show’))
    
    170
    +        Just :: forall a. a -> Maybe a
    
    171
    +          with Just @Bool
    
    172
    +          (imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17
    
    173
    +           (and originally defined in ‘GHC.Internal.Maybe’))
    
    174 174
     
    
    175 175
     valid_hole_fits.hs:34:14: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    176 176
         • Found hole: _ :: Bool
    
    ... ... @@ -213,7 +213,7 @@ valid_hole_fits.hs:38:10: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    213 213
               with (:) @a
    
    214 214
               (bound at <wired into compiler>)
    
    215 215
             (<$) :: forall (f :: * -> *) a b. Functor f => a -> f b -> f a
    
    216
    -          with (<$) @[] @a @a
    
    216
    +          with (<$) @[]
    
    217 217
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    218 218
                (and originally defined in ‘GHC.Internal.Base’))
    
    219 219
             seq :: forall a b. a -> b -> b
    
    ... ... @@ -243,16 +243,16 @@ valid_hole_fits.hs:41:8: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    243 243
               with readIO @()
    
    244 244
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    245 245
                (and originally defined in ‘GHC.Internal.System.IO’))
    
    246
    -        print :: forall a. Show a => a -> IO ()
    
    247
    -          with print @String
    
    248
    -          (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    249
    -           (and originally defined in ‘GHC.Internal.System.IO’))
    
    250 246
             fail :: forall (m :: * -> *) a.
    
    251 247
                     (MonadFail m, GHC.Internal.Stack.Types.HasCallStack) =>
    
    252 248
                     String -> m a
    
    253
    -          with fail @IO @()
    
    249
    +          with fail @IO
    
    254 250
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    255 251
                (and originally defined in ‘GHC.Internal.Control.Monad.Fail’))
    
    252
    +        print :: forall a. Show a => a -> IO ()
    
    253
    +          with print @String
    
    254
    +          (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    
    255
    +           (and originally defined in ‘GHC.Internal.System.IO’))
    
    256 256
             mempty :: forall a. Monoid a => a
    
    257 257
               with mempty @(String -> IO ())
    
    258 258
               (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40
    

  • testsuite/tests/typecheck/should_compile/valid_hole_fits_interactions.stderr
    1
    -
    
    2 1
     valid_hole_fits_interactions.hs:15:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)]
    
    3 2
         • Found hole: _ :: SBool True
    
    4 3
         • In an equation for ‘f’: f = _
    
    5 4
         • Relevant bindings include
    
    6 5
             f :: SBool True (bound at valid_hole_fits_interactions.hs:15:1)
    
    7 6
           Valid hole fits include
    
    8
    -        f :: SBool True (bound at valid_hole_fits_interactions.hs:15:1)
    
    9 7
             STrue :: SBool True
    
    10 8
               (defined at valid_hole_fits_interactions.hs:12:3)
    
    9
    +        f :: SBool True (bound at valid_hole_fits_interactions.hs:15:1)
    
    10
    +

  • testsuite/tests/typecheck/should_fail/T14884.stderr
    ... ... @@ -5,18 +5,18 @@ T14884.hs:4:5: error: [GHC-88464]
    5 5
           In an equation for ‘x’: x = _ print "abc"
    
    6 6
         • Relevant bindings include x :: IO () (bound at T14884.hs:4:1)
    
    7 7
           Valid hole fits include
    
    8
    +        foldMap :: forall (t :: * -> *) m a.
    
    9
    +                   (Foldable t, Monoid m) =>
    
    10
    +                   (a -> m) -> t a -> m
    
    11
    +          with foldMap @[]
    
    12
    +          (imported from ‘Prelude’
    
    13
    +           (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    8 14
             mapM_ :: forall (t :: * -> *) (m :: * -> *) a b.
    
    9 15
                      (Foldable t, Monad m) =>
    
    10 16
                      (a -> m b) -> t a -> m ()
    
    11 17
               with mapM_ @[] @IO @Char @()
    
    12 18
               (imported from ‘Prelude’
    
    13 19
                (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    14
    -        foldMap :: forall (t :: * -> *) m a.
    
    15
    -                   (Foldable t, Monoid m) =>
    
    16
    -                   (a -> m) -> t a -> m
    
    17
    -          with foldMap @[] @(IO ()) @Char
    
    18
    -          (imported from ‘Prelude’
    
    19
    -           (and originally defined in ‘GHC.Internal.Data.Foldable’))
    
    20 20
             id :: forall a. a -> a
    
    21 21
               with id @(String -> IO ())
    
    22 22
               (imported from ‘Prelude’