File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2598,13 +2598,21 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
2598
2598
auto classification = classifier.classifyConformance (
2599
2599
S->getSequenceConformance (), EffectKind::Throws);
2600
2600
auto throwsKind = classification.getConditionalKind (EffectKind::Throws);
2601
+
2602
+ if (throwsKind != ConditionalEffectKind::None)
2603
+ Flags.set (ContextFlags::HasAnyThrowSite);
2604
+
2601
2605
if (!CurContext.handlesThrows (throwsKind))
2602
2606
CurContext.diagnoseUnhandledThrowStmt (Ctx.Diags , S);
2603
2607
}
2604
2608
2605
2609
auto classification = classifier.classifyConformance (
2606
2610
S->getSequenceConformance (), EffectKind::Async);
2607
2611
auto asyncKind = classification.getConditionalKind (EffectKind::Async);
2612
+
2613
+ if (asyncKind != ConditionalEffectKind::None)
2614
+ Flags.set (ContextFlags::HasAnyAsyncSite);
2615
+
2608
2616
if (!CurContext.handlesAsync (asyncKind))
2609
2617
CurContext.diagnoseUnhandledAsyncSite (Ctx.Diags , S, Context::Unspecified);
2610
2618
Original file line number Diff line number Diff line change @@ -54,4 +54,13 @@ func doubleDiagCheckConcrete(_ seq: ThrowingAsyncSequence) async {
54
54
var it = seq. makeAsyncIterator ( )
55
55
// expected-error@+1{{call can throw, but it is not marked with 'try' and the error is not handled}}
56
56
let _ = await it. next ( )
57
- }
57
+ }
58
+
59
+ // rdar://75274975
60
+ func forAwaitInsideDoCatch< Source: AsyncSequence > ( _ source: Source ) async {
61
+ do {
62
+ for try await item in source {
63
+ print ( item)
64
+ }
65
+ } catch { } // no-warning
66
+ }
You can’t perform that action at this time.
0 commit comments