Skip to content
  • Vasily Sterekhov's avatar
    Make some evidence uses reachable by toHie · 4f192947
    Vasily Sterekhov authored and Marge Bot's avatar Marge Bot committed
    Resolves #23540, #23120
    
    This adds spans to certain expressions in the typechecker and renamer,
    and lets 'toHie' make use of those spans. Therefore the relevant
    evidence uses for the following syntax will now show up under the
    expected nodes in 'HieAst's:
    
    - Overloaded literals ('IsString', 'Num', 'Fractional')
    
    - Natural patterns and N+k patterns ('Eq', 'Ord', and instances from the
      overloaded literals being matched on)
    
    - Arithmetic sequences ('Enum')
    
    - Monadic bind statements ('Monad')
    
    - Monadic body statements ('Monad', 'Alternative')
    
    - ApplicativeDo ('Applicative', 'Functor')
    
    - Overloaded lists ('IsList')
    
    Also see Note [Source locations for implicit function calls]
    
    In the process of handling overloaded lists I added an extra 'SrcSpan'
    field to 'VAExpansion' - this allows us to more accurately reconstruct
    the locations from the renamer in 'rebuildHsApps'. This also happens to
    fix #23120.
    
    See the additions to Note [Looking through HsExpanded]
    4f192947