Skip to content
Snippets Groups Projects
  • Matthew Pickering's avatar
    3d66a218
    Store RdrName rather than OccName in Holes · 3d66a218
    Matthew Pickering authored
    In #20472 it was pointed out that you couldn't defer out of scope but
    the implementation collapsed a RdrName into an OccName to stuff it into
    a Hole. This leads to the error message for a deferred qualified name
    dropping the qualification which affects the quality of the error
    message.
    
    This commit adds a bit more structure to a hole, so a hole can replace a
    RdrName without losing information about what that RdrName was. This is
    important when printing error messages.
    
    I also added a test which checks the Template Haskell deferral of out of
    scope qualified names works properly.
    
    Fixes #22130
    3d66a218
    History
    Store RdrName rather than OccName in Holes
    Matthew Pickering authored
    In #20472 it was pointed out that you couldn't defer out of scope but
    the implementation collapsed a RdrName into an OccName to stuff it into
    a Hole. This leads to the error message for a deferred qualified name
    dropping the qualification which affects the quality of the error
    message.
    
    This commit adds a bit more structure to a hole, so a hole can replace a
    RdrName without losing information about what that RdrName was. This is
    important when printing error messages.
    
    I also added a test which checks the Template Haskell deferral of out of
    scope qualified names works properly.
    
    Fixes #22130
TH.hs 51.20 KiB