@@ -1226,8 +1226,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
1226
1226
1227
1227
ASTContext &Ctx;
1228
1228
1229
- ApplyClassifier Classifier;
1230
-
1229
+ DeclContext *RethrowsDC = nullptr ;
1231
1230
Context CurContext;
1232
1231
1233
1232
class ContextFlags {
@@ -1296,7 +1295,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
1296
1295
public:
1297
1296
ContextScope (CheckEffectsCoverage &self, Optional<Context> newContext)
1298
1297
: Self(self), OldContext(self.CurContext),
1299
- OldRethrowsDC (self.Classifier. RethrowsDC),
1298
+ OldRethrowsDC (self.RethrowsDC),
1300
1299
OldFlags(self.Flags),
1301
1300
OldMaxThrowingKind(self.MaxThrowingKind) {
1302
1301
if (newContext) self.CurContext = *newContext;
@@ -1306,7 +1305,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
1306
1305
ContextScope &operator =(const ContextScope &) = delete ;
1307
1306
1308
1307
void enterSubFunction () {
1309
- Self.Classifier . RethrowsDC = nullptr ;
1308
+ Self.RethrowsDC = nullptr ;
1310
1309
}
1311
1310
1312
1311
void enterTry () {
@@ -1372,7 +1371,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
1372
1371
1373
1372
~ContextScope () {
1374
1373
Self.CurContext = OldContext;
1375
- Self.Classifier . RethrowsDC = OldRethrowsDC;
1374
+ Self.RethrowsDC = OldRethrowsDC;
1376
1375
Self.Flags = OldFlags;
1377
1376
Self.MaxThrowingKind = OldMaxThrowingKind;
1378
1377
}
@@ -1384,7 +1383,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
1384
1383
MaxThrowingKind (ThrowingKind::None) {
1385
1384
1386
1385
if (auto rethrowsDC = initialContext.getRethrowsDC ()) {
1387
- Classifier. RethrowsDC = rethrowsDC;
1386
+ RethrowsDC = rethrowsDC;
1388
1387
}
1389
1388
}
1390
1389
@@ -1494,7 +1493,9 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
1494
1493
ShouldRecurse_t checkApply (ApplyExpr *E) {
1495
1494
// An apply expression is a potential throw site if the function throws.
1496
1495
// But if the expression didn't type-check, suppress diagnostics.
1497
- auto classification = Classifier.classifyApply (E);
1496
+ ApplyClassifier classifier;
1497
+ classifier.RethrowsDC = RethrowsDC;
1498
+ auto classification = classifier.classifyApply (E);
1498
1499
1499
1500
checkThrowAsyncSite (E, /* requiresTry*/ true , classification);
1500
1501
0 commit comments