Skip to content

Commit cced985

Browse files
authored
Merge pull request #84470 from tshortli/skip-isolated-deinit-availability-diags-during-emit-module-6.2
[6.2] Sema: Don't diagnose isolated deinit availability in skipped function bodies
2 parents aa4abec + 8f61ec2 commit cced985

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
133133
}
134134

135135
if (!getActorIsolation(nominal).isMainActor() && destructor->hasBody()) {
136+
// In module emission jobs, type checking the body of the destructor may
137+
// be skipped which means availability in the body cannot be diagnosed
138+
// accurately.
139+
if (destructor->isBodySkipped())
140+
return;
141+
136142
TypeChecker::checkAvailability(
137143
destructor->getBodySourceRange(), C.getIsolatedDeinitAvailability(),
138144
D->getDeclContext(),

test/Concurrency/deinit_isolation_availability.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
// RUN: %target-typecheck-verify-swift -swift-version 5 %s -strict-concurrency=complete -target %target-swift-6.1-abi-triple
33
// RUN: %target-typecheck-verify-swift -swift-version 5 %s -strict-concurrency=complete -target %target-swift-6.1-abi-triple -target-min-inlining-version min -verify-additional-prefix inlining-
44

5+
// Test -emit-module configurations.
6+
7+
// RUN: %target-swift-frontend -emit-module -verify -swift-version 5 %s -strict-concurrency=complete -target %target-swift-5.1-abi-triple -experimental-skip-non-inlinable-function-bodies -verify-additional-prefix inlining-
8+
// RUN: %target-swift-frontend -emit-module -verify -swift-version 5 %s -strict-concurrency=complete -target %target-swift-6.1-abi-triple -experimental-skip-non-inlinable-function-bodies -target-min-inlining-version min -verify-additional-prefix inlining-
9+
510
// REQUIRES: concurrency
611
// REQUIRES: OS=macosx
712

0 commit comments

Comments
 (0)