[commit: ghc] wip/api-annots: Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected. (4d290ad)

git at git.haskell.org git at git.haskell.org
Sat May 9 14:17:40 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/api-annots
Link       : http://ghc.haskell.org/trac/ghc/changeset/4d290ad44ee56d7da9d6c780ce581c64e11331e9/ghc

>---------------------------------------------------------------

commit 4d290ad44ee56d7da9d6c780ce581c64e11331e9
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Fri May 8 11:22:47 2015 +0200

    Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected.
    
    Summary:
    The code for mkAtDefault is as follows.
    
        mkATDefault (L loc (TyFamInstDecl { tfid_eqn = L _ e }))
              | TyFamEqn { tfe_tycon = tc, tfe_pats = pats, tfe_rhs = rhs } <- e
              = do { tvs <- checkTyVars (ptext (sLit "default")) equalsDots tc (hswb_cts pats)
                   ; return (L loc (TyFamEqn { tfe_tycon = tc
                                             , tfe_pats = tvs
                                             , tfe_rhs = rhs })) }
    
    An associated type in a class of the form
    
        type FoldableConstraint t x = ()
    
    has an AnnEqual attached to the location in tfid_eqn. Since the location
    is discarded, this annotation is then disconnected from the AST.
    
    Test Plan: ./validate
    
    Reviewers: hvr, austin
    
    Subscribers: bgamari, thomie, mpickering
    
    Differential Revision: https://phabricator.haskell.org/D842
    
    GHC Trac Issues: #10307
    
    Conflicts:
    	testsuite/tests/ghc-api/annotations/.gitignore
    	testsuite/tests/ghc-api/annotations/Makefile
    	testsuite/tests/ghc-api/annotations/all.T


>---------------------------------------------------------------

4d290ad44ee56d7da9d6c780ce581c64e11331e9
 compiler/parser/Parser.y                           | 32 +++++++++++--------
 testsuite/tests/ghc-api/annotations/.gitignore     |  1 +
 testsuite/tests/ghc-api/annotations/Makefile       |  8 +++++
 testsuite/tests/ghc-api/annotations/T10307.stdout  | 36 ++++++++++++++++++++++
 testsuite/tests/ghc-api/annotations/Test10307.hs   |  6 ++++
 testsuite/tests/ghc-api/annotations/all.T          |  1 +
 .../ghc-api/annotations/{t10312.hs => t10307.hs}   |  2 +-
 7 files changed, 72 insertions(+), 14 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4d290ad44ee56d7da9d6c780ce581c64e11331e9


More information about the ghc-commits mailing list