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) {
2629
2629
if (features.empty ())
2630
2630
return features;
2631
2631
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 ();
2633
2637
if (!enclosingDecl)
2634
2638
return features;
2635
2639
2636
- if (!isa<NominalTypeDecl>(enclosingDecl) &&
2637
- !isa<ExtensionDecl>(enclosingDecl))
2638
- return features;
2639
-
2640
2640
auto enclosingFeatures = getFeaturesUsed (enclosingDecl);
2641
2641
if (enclosingFeatures.empty ())
2642
2642
return features;
Original file line number Diff line number Diff line change @@ -73,6 +73,17 @@ public class OldSchool: MP {
73
73
func f( ) throws
74
74
}
75
75
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
+
76
87
// CHECK: #if compiler(>=5.3) && $RethrowsProtocol
77
88
// CHECK-NEXT: public func acceptsRP
78
89
public func acceptsRP< T: RP > ( _: T ) { }
You can’t perform that action at this time.
0 commit comments