[GHC] #10307: Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected.

GHC ghc-devs at haskell.org
Mon May 11 07:33:30 UTC 2015


#10307: Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be
disconnected.
-------------------------------------+-------------------------------------
        Reporter:  alanz             |                   Owner:  alanz
            Type:  bug               |                  Status:  patch
        Priority:  normal            |               Milestone:  7.10.2
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |  ApiAnnotations
 Type of failure:  None/Unknown      |            Architecture:
      Blocked By:                    |  Unknown/Multiple
 Related Tickets:                    |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:  Phab:D842
-------------------------------------+-------------------------------------

Comment (by Alan Zimmerman <alan.zimm@…>):

 In [changeset:"811b72adedcd12149783eac19ebccff1dd72bc1c/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="811b72adedcd12149783eac19ebccff1dd72bc1c"
 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
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10307#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list