Add optional message to unavailablefromasync

Adding the ability to add an optional message to the unavailable from
async attribute. This can be used to indicate other possible API to use,
or help explain why it's unavailable.
This commit is contained in:
Evan Wilde
2021-12-01 17:27:11 -08:00
parent cce3e8a7f5
commit 3a13721eae
12 changed files with 110 additions and 9 deletions

View File

@@ -2754,6 +2754,16 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
TypeSequenceDeclAttrLayout::emitRecord(S.Out, S.ScratchRecord, abbrCode);
return;
}
case DAK_UnavailableFromAsync: {
auto abbrCode =
S.DeclTypeAbbrCodes[UnavailableFromAsyncDeclAttrLayout::Code];
auto *theAttr = cast<UnavailableFromAsyncAttr>(DA);
UnavailableFromAsyncDeclAttrLayout::emitRecord(
S.Out, S.ScratchRecord, abbrCode, theAttr->isImplicit(),
theAttr->Message);
return;
}
}
}