File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2676,6 +2676,13 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2676
2676
return AFD->getResilienceExpansion () != ResilienceExpansion::Minimal;
2677
2677
}
2678
2678
2679
+ // / FIXME: This is an egregious hack to turn off availability checking
2680
+ // / for specific functions that were missing availability in older versions
2681
+ // / of existing libraries that we must nonethess still support.
2682
+ static bool hasHistoricallyWrongAvailability (FuncDecl *func) {
2683
+ return func->getName ().isCompoundName (" swift_deletedAsyncMethodError" , { });
2684
+ }
2685
+
2679
2686
void visitFuncDecl (FuncDecl *FD) {
2680
2687
// Force these requests in case they emit diagnostics.
2681
2688
(void ) FD->getInterfaceType ();
@@ -2721,7 +2728,8 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2721
2728
2722
2729
checkImplementationOnlyOverride (FD);
2723
2730
2724
- if (FD->getAsyncLoc ().isValid ())
2731
+ if (FD->getAsyncLoc ().isValid () &&
2732
+ !hasHistoricallyWrongAvailability (FD))
2725
2733
TypeChecker::checkConcurrencyAvailability (FD->getAsyncLoc (), FD);
2726
2734
2727
2735
if (requiresDefinition (FD) && !FD->hasBody ()) {
Original file line number Diff line number Diff line change @@ -7,3 +7,7 @@ func f() async { } // expected-error{{concurrency is only available in}}
7
7
8
8
actor A { } // expected-error{{concurrency is only available in}}
9
9
// expected-note@-1{{add @available}}
10
+
11
+ // Allow this without any availability for Historical Reasons.
12
+ public func swift_deletedAsyncMethodError( ) async {
13
+ }
You can’t perform that action at this time.
0 commit comments