Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected.
ClosedPublic

Authored by alanz on Apr 15 2015, 9:27 AM.

Details

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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alanz updated this revision to Diff 2770.Apr 15 2015, 9:27 AM
alanz retitled this revision from to Api Annotations: RdrHsSyn.mkAtDefault causes annotations to be disconnected..
alanz updated this object.
alanz edited the test plan for this revision. (Show Details)
alanz added reviewers: hvr, austin.
alanz updated the Trac tickets for this revision.
alanz added a subscriber: mpickering.
alanz updated this revision to Diff 2794.Apr 17 2015, 9:02 AM

Rebase against D833

alanz updated this revision to Diff 2852.Apr 27 2015, 7:23 AM

Re-attach annotations for all ty_fam_inst_eqn usages

alanz updated this revision to Diff 2879.May 5 2015, 3:57 PM

Rebase against master, removing dependency on D833

alanz updated this revision to Diff 2901.May 8 2015, 4:58 AM

Rebase against master

austin accepted this revision.May 10 2015, 6:04 PM
austin edited edge metadata.

lgtm

This revision is now accepted and ready to land.May 10 2015, 6:04 PM
This revision was automatically updated to reflect the committed changes.