mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Introduce a suppressible feature for availability on associated types
This allows us to emit Swift interfaces that can be handled by older Swift compilers.
This commit is contained in:
@@ -3305,6 +3305,20 @@ static bool usesFeatureNoAsyncAvailability(Decl *decl) {
|
||||
return decl->getAttrs().getNoAsync(decl->getASTContext()) != nullptr;
|
||||
}
|
||||
|
||||
static bool usesFeatureAssociatedTypeAvailability(Decl *decl) {
|
||||
return isa<AssociatedTypeDecl>(decl) &&
|
||||
decl->getAttrs().hasAttribute<AvailableAttr>();
|
||||
}
|
||||
|
||||
static void
|
||||
suppressingFeatureAssociatedTypeAvailability(
|
||||
PrintOptions &options, llvm::function_ref<void()> action) {
|
||||
unsigned originalExcludeAttrCount = options.ExcludeAttrList.size();
|
||||
options.ExcludeAttrList.push_back(DeclAttrKind::Available);
|
||||
action();
|
||||
options.ExcludeAttrList.resize(originalExcludeAttrCount);
|
||||
}
|
||||
|
||||
static bool usesFeatureBuiltinIntLiteralAccessors(Decl *decl) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user