Skip to content
  • Ryan Scott's avatar
    Fix #15527 by pretty-printing an RdrName prefixly · fb8b2cb1
    Ryan Scott authored
    Summary:
    When `(.) @Int` is used without enabling `TypeApplications`,
    the resulting error message will pretty-print the (symbolic)
    `RdrName` `(.)`. However, it does so without parenthesizing it, which
    causes the pretty-printed expression to appear as `.@Int`. Yuck.
    
    Since the expression in a type application will always be prefix,
    we can fix this issue by using `pprPrefixOcc` instead of plain ol'
    `ppr`.
    
    Test Plan: make test TEST=T15527
    
    Reviewers: bgamari, monoidal, simonpj
    
    Reviewed By: monoidal, simonpj
    
    Subscribers: rwbarton, carter
    
    GHC Trac Issues: #15527
    
    Differential Revision: https://phabricator.haskell.org/D5071
    
    (cherry picked from commit 5238f204)
    fb8b2cb1