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

GHC ghc-devs at haskell.org
Wed Apr 15 12:50:28 UTC 2015


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

 {{{#!hs
 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

 {{{#!hs
   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.

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


More information about the ghc-tickets mailing list