[SE-0258] Promote projection variables ($foo) to the original property access

When the outermost property wrapper associated with a property has a
`wrapperValue`, create the projection property (with the `$` prefix)
at the same access level as the original property. This puts the
wrapped-value interface and the projection interface at the same level.

The newly-introduced @_projectionValueProperty attribute is implicitly
created to establish the link between the original property and the
projection value within module interfaces, where both properties will
be explicitly written out.
This commit is contained in:
Doug Gregor
2019-06-25 22:02:18 -07:00
parent 446d0b3953
commit 7bb01c743b
16 changed files with 179 additions and 12 deletions

View File

@@ -2510,6 +2510,17 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
S.addTypeRef(theAttr->getTypeLoc().getType()));
return;
}
case DAK_ProjectionValueProperty: {
auto abbrCode =
S.DeclTypeAbbrCodes[ProjectionValuePropertyDeclAttrLayout::Code];
auto theAttr = cast<ProjectionValuePropertyAttr>(DA);
ProjectionValuePropertyDeclAttrLayout::emitRecord(
S.Out, S.ScratchRecord, abbrCode, theAttr->isImplicit(),
S.addDeclBaseNameRef(theAttr->ProjectionPropertyName));
break;
}
}
}