[commit: ghc] wip/7.10-api-annots2: Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected. (9e1e4ee)

git at git.haskell.org git at git.haskell.org
Mon May 11 21:36:54 UTC 2015


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

On branch  : wip/7.10-api-annots2
Link       : http://ghc.haskell.org/trac/ghc/changeset/9e1e4eecd00cbdd791970f3226e99c82ef1d9ec1/ghc

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

commit 9e1e4eecd00cbdd791970f3226e99c82ef1d9ec1
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Mon May 11 09:34:27 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
    
    Reviewed By: austin
    
    Subscribers: bgamari, thomie, mpickering
    
    Differential Revision: https://phabricator.haskell.org/D842
    
    GHC Trac Issues: #10307
    
    (cherry picked from commit 811b72adedcd12149783eac19ebccff1dd72bc1c)
    
    Conflicts:
    	compiler/parser/Parser.y


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

9e1e4eecd00cbdd791970f3226e99c82ef1d9ec1
 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 9e1e4eecd00cbdd791970f3226e99c82ef1d9ec1


More information about the ghc-commits mailing list