File tree Expand file tree Collapse file tree 5 files changed +8
-20
lines changed Expand file tree Collapse file tree 5 files changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -163,9 +163,6 @@ class alignas(8) Pattern {
163
163
});
164
164
}
165
165
166
- // / Does this binding declare something that requires storage?
167
- bool hasStorage () const ;
168
-
169
166
static bool classof (const Pattern *P) { return true ; }
170
167
171
168
// *** Allocation Routines ************************************************/
Original file line number Diff line number Diff line change @@ -1132,10 +1132,14 @@ StaticSpellingKind PatternBindingDecl::getCorrectStaticSpelling() const {
1132
1132
bool PatternBindingDecl::hasStorage () const {
1133
1133
// Walk the pattern, to check to see if any of the VarDecls included in it
1134
1134
// have storage.
1135
+ bool HasStorage = false ;
1135
1136
for (auto entry : getPatternList ())
1136
- if (entry.getPattern ()->hasStorage ())
1137
- return true ;
1138
- return false ;
1137
+ entry.getPattern ()->forEachVariable ([&](VarDecl *VD) {
1138
+ if (VD->hasStorage ())
1139
+ HasStorage = true ;
1140
+ });
1141
+
1142
+ return HasStorage;
1139
1143
}
1140
1144
1141
1145
void PatternBindingDecl::setPattern (unsigned i, Pattern *P) {
Original file line number Diff line number Diff line change @@ -237,16 +237,6 @@ void Pattern::forEachNode(const std::function<void(Pattern*)> &f) {
237
237
}
238
238
}
239
239
240
- bool Pattern::hasStorage () const {
241
- bool HasStorage = false ;
242
- forEachVariable ([&](VarDecl *VD) {
243
- if (VD->hasStorage ())
244
- HasStorage = true ;
245
- });
246
-
247
- return HasStorage;
248
- }
249
-
250
240
// / Return true if this is a non-resolved ExprPattern which is syntactically
251
241
// / irrefutable.
252
242
static bool isIrrefutableExprPattern (const ExprPattern *EP) {
Original file line number Diff line number Diff line change @@ -2866,7 +2866,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2866
2866
// default-initializable. If so, do it.
2867
2867
if (PBD->getPattern (i)->hasType () &&
2868
2868
!PBD->getInit (i) &&
2869
- PBD->getPattern (i)-> hasStorage () &&
2869
+ PBD->hasStorage () &&
2870
2870
!PBD->getPattern (i)->getType ()->is <ErrorType>()) {
2871
2871
2872
2872
// If we have a type-adjusting attribute (like ownership), apply it now.
Original file line number Diff line number Diff line change @@ -50,9 +50,6 @@ class SwiftGizmo : A {
50
50
@NSManaged func mutableArrayValueForB( ) { } // expected-error {{NSManaged method cannot have a body; it must be provided at runtime}}
51
51
@NSManaged class func mutableArrayValueForA( ) { } // expected-error {{@NSManaged only allowed on an instance property or method}}
52
52
53
- // SR-1050: don't assert
54
- @NSManaged var multiA , multiB , multiC : NSNumber ?
55
-
56
53
override init ( ) { }
57
54
}
58
55
You can’t perform that action at this time.
0 commit comments