Sjoerd Visscher pushed to branch wip/T18570 at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • compiler/GHC/Tc/Errors/Ppr.hs
    ... ... @@ -3541,12 +3541,12 @@ pprHoleFit :: HoleFitDispConfig -> HoleFit -> SDoc
    3541 3541
     pprHoleFit _ (RawHoleFit sd) = sd
    
    3542 3542
     pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
    
    3543 3543
      hang display 2 provenance
    
    3544
    - where tyApp = sep $ zipWithEqual pprArg vars hfWrap
    
    3544
    + where tyApps = concat $ zipWithEqual pprArg vars hfWrap
    
    3545 3545
              where pprArg b arg = case binderFlag b of
    
    3546
    -                                Specified -> text "@" <> pprParendType arg
    
    3546
    +                                Specified -> [text "@" <> pprParendType arg]
    
    3547 3547
                                       -- Do not print type application for inferred
    
    3548 3548
                                       -- variables (#16456)
    
    3549
    -                                Inferred  -> empty
    
    3549
    +                                Inferred  -> []
    
    3550 3550
                                     Required  -> pprPanic "pprHoleFit: bad Required"
    
    3551 3551
                                                              (ppr b <+> ppr arg)
    
    3552 3552
            tyAppVars = sep $ punctuate comma $
    
    ... ... @@ -3573,9 +3573,9 @@ pprHoleFit (HFDC sWrp sWrpVars sTy sProv sMs) (TcHoleFit (HoleFit {..})) =
    3573 3573
                        IdHFCand id_    -> pprPrefixOcc id_
    
    3574 3574
            tyDisp = ppWhen sTy $ dcolon <+> ppr hfType
    
    3575 3575
            has = not . null
    
    3576
    -       wrapDisp = ppWhen (has hfWrap && (sWrp || sWrpVars))
    
    3576
    +       wrapDisp = ppWhen (has tyApps && (sWrp || sWrpVars))
    
    3577 3577
                        $ text "with" <+> if sWrp || not sTy
    
    3578
    -                                     then occDisp <+> tyApp
    
    3578
    +                                     then occDisp <+> sep tyApps
    
    3579 3579
                                          else tyAppVars
    
    3580 3580
            docs = case hfDoc of
    
    3581 3581
                     Just d -> pprHsDocStrings d
    

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

  • testsuite/tests/overloadedrecflds/should_fail/T23063.stderr
    ... ... @@ -7,7 +7,6 @@ T23063.hs:5:7: error: [GHC-88464]
    7 7
           Valid hole fits include
    
    8 8
             baz :: A.S -> Int (defined at T23063.hs:5:1)
    
    9 9
             A.foo :: A.S -> Int
    
    10
    -          with A.foo
    
    11 10
               (imported qualified from ‘T23063_aux’ at T23063.hs:3:1-32
    
    12 11
                (and originally defined at T23063_aux.hs:4:16-18))
    
    13 12