Simon Peyton Jones pushed to branch wip/T27466 at Glasgow Haskell Compiler / GHC
Commits:
-
397b8c44
by Simon Peyton Jones at 2026-07-03T03:31:35+01:00
1 changed file:
Changes:
| ... | ... | @@ -292,14 +292,14 @@ noParens :: SDoc -> SDoc |
| 292 | 292 | noParens pp = pp
|
| 293 | 293 | |
| 294 | 294 | pprOptCo :: Coercion -> SDoc
|
| 295 | --- Print a coercion with its type
|
|
| 295 | +-- Print a coercion with its type (unless suppressed by -dsuppress-coercion-types)
|
|
| 296 | 296 | -- Honour -dsuppress-coercions
|
| 297 | 297 | -- Placed here because it needs GHC.Core.Coercion.coercionType
|
| 298 | -pprOptCo co = sep [pprCo co, dcolon <+> co_type]
|
|
| 299 | - where
|
|
| 300 | - co_type = sdocOption sdocSuppressCoercionTypes $ \case
|
|
| 301 | - True -> ellipsis
|
|
| 302 | - False -> ppr (coercionType co)
|
|
| 298 | +pprOptCo co = sdocOption sdocSuppressCoercionTypes $ \case
|
|
| 299 | + True -> pprParendCo co
|
|
| 300 | + False -> parens (sep [pprCo co, dcolon <+> pp_co_type])
|
|
| 301 | + where
|
|
| 302 | + pp_co_type = ppr (coercionType co)
|
|
| 303 | 303 | |
| 304 | 304 | ppr_id_occ :: (SDoc -> SDoc) -> Id -> SDoc
|
| 305 | 305 | ppr_id_occ add_par id
|