File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -2629,14 +2629,14 @@ static std::vector<Feature> getUniqueFeaturesUsed(Decl *decl) {
26292629 if (features.empty ())
26302630 return features;
26312631
2632- auto enclosingDecl = decl->getDeclContext ()->getAsDecl ();
2632+ Decl *enclosingDecl;
2633+ if (auto accessor = dyn_cast<AccessorDecl>(decl))
2634+ enclosingDecl = accessor->getStorage ();
2635+ else
2636+ enclosingDecl = decl->getDeclContext ()->getAsDecl ();
26332637 if (!enclosingDecl)
26342638 return features;
26352639
2636- if (!isa<NominalTypeDecl>(enclosingDecl) &&
2637- !isa<ExtensionDecl>(enclosingDecl))
2638- return features;
2639-
26402640 auto enclosingFeatures = getFeaturesUsed (enclosingDecl);
26412641 if (enclosingFeatures.empty ())
26422642 return features;
Original file line number Diff line number Diff line change @@ -73,6 +73,17 @@ public class OldSchool: MP {
7373 func f( ) throws
7474}
7575
76+ // CHECK: public struct UsesRP {
77+ public struct UsesRP {
78+ // CHECK: #if compiler(>=5.3) && $RethrowsProtocol
79+ // CHECK-NEXT: public var value: FeatureTest.RP? {
80+ // CHECK-NOT: #if compiler(>=5.3) && $RethrowsProtocol
81+ // CHECK: get
82+ public var value : RP ? {
83+ nil
84+ }
85+ }
86+
7687// CHECK: #if compiler(>=5.3) && $RethrowsProtocol
7788// CHECK-NEXT: public func acceptsRP
7889public func acceptsRP< T: RP > ( _: T ) { }
You can’t perform that action at this time.
0 commit comments