File tree 3 files changed +14
-8
lines changed
3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -2963,7 +2963,13 @@ static bool usesFeatureTypeWrappers(Decl *decl) {
2963
2963
}
2964
2964
2965
2965
static bool usesFeatureRuntimeDiscoverableAttrs (Decl *decl) {
2966
- return decl->getAttrs ().hasAttribute <RuntimeMetadataAttr>();
2966
+ if (decl->getAttrs ().hasAttribute <RuntimeMetadataAttr>())
2967
+ return true ;
2968
+
2969
+ if (auto *VD = dyn_cast<ValueDecl>(decl))
2970
+ return !VD->getRuntimeDiscoverableAttrs ().empty ();
2971
+
2972
+ return false ;
2967
2973
}
2968
2974
2969
2975
static bool usesFeatureParserRoundTrip (Decl *decl) {
Original file line number Diff line number Diff line change @@ -9702,3 +9702,10 @@ ValueDecl::getRuntimeDiscoverableAttrTypeDecl(CustomAttr *attr) const {
9702
9702
assert (nominal->getAttrs ().hasAttribute <RuntimeMetadataAttr>());
9703
9703
return nominal;
9704
9704
}
9705
+
9706
+ ArrayRef<CustomAttr *> ValueDecl::getRuntimeDiscoverableAttrs () const {
9707
+ auto *mutableSelf = const_cast <ValueDecl *>(this );
9708
+ return evaluateOrDefault (getASTContext ().evaluator ,
9709
+ GetRuntimeDiscoverableAttributes{mutableSelf},
9710
+ nullptr );
9711
+ }
Original file line number Diff line number Diff line change 29
29
using namespace swift ;
30
30
using namespace constraints ;
31
31
32
- ArrayRef<CustomAttr *> ValueDecl::getRuntimeDiscoverableAttrs () const {
33
- auto *mutableSelf = const_cast <ValueDecl *>(this );
34
- return evaluateOrDefault (getASTContext ().evaluator ,
35
- GetRuntimeDiscoverableAttributes{mutableSelf},
36
- nullptr );
37
- }
38
-
39
32
std::pair<BraceStmt *, Type>
40
33
ValueDecl::getRuntimeDiscoverableAttributeGenerator (CustomAttr *attr) const {
41
34
auto *mutableSelf = const_cast <ValueDecl *>(this );
You can’t perform that action at this time.
0 commit comments