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 @@ -2568,6 +2568,13 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2568
2568
return AFD->getResilienceExpansion () != ResilienceExpansion::Minimal;
2569
2569
}
2570
2570
2571
+ // / FIXME: This is an egregious hack to turn off availability checking
2572
+ // / for specific functions that were missing availability in older versions
2573
+ // / of existing libraries that we must nonethess still support.
2574
+ static bool hasHistoricallyWrongAvailability (FuncDecl *func) {
2575
+ return func->getName ().isCompoundName (" swift_deletedAsyncMethodError" , { });
2576
+ }
2577
+
2571
2578
void visitFuncDecl (FuncDecl *FD) {
2572
2579
// Force these requests in case they emit diagnostics.
2573
2580
(void ) FD->getInterfaceType ();
@@ -2612,7 +2619,8 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2612
2619
2613
2620
checkImplementationOnlyOverride (FD);
2614
2621
2615
- if (FD->getAsyncLoc ().isValid ())
2622
+ if (FD->getAsyncLoc ().isValid () &&
2623
+ !hasHistoricallyWrongAvailability (FD))
2616
2624
TypeChecker::checkConcurrencyAvailability (FD->getAsyncLoc (), FD);
2617
2625
2618
2626
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