[commit: ghc] ghc-7.10: Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected. (bc4968f)

git at git.haskell.org git at git.haskell.org
Mon May 11 22:30:05 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/bc4968f40da5ac6764623466915175377fa6f4dc/ghc

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

commit bc4968f40da5ac6764623466915175377fa6f4dc
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


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

bc4968f40da5ac6764623466915175377fa6f4dc
 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 bc4968f40da5ac6764623466915175377fa6f4dc


More information about the ghc-commits mailing list