mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SE-0296] Enable async/await by default.
Always parse `async` and `await`, allowing the definition and use of asynchronous functions without the "experimental concurrency" flag. Note that, at present, use of asynchronous functions requires one to explicitly import or link against the `_Concurrency` library. We'll sort this out in a follow-up change. Tracked by rdar://73455330.
This commit is contained in:
@@ -5219,9 +5219,6 @@ bool RefactoringActionConvertCallToAsyncAlternative::isApplicable(
|
||||
const ResolvedCursorInfo &CursorInfo, DiagnosticEngine &Diag) {
|
||||
using namespace asyncrefactorings;
|
||||
|
||||
if (!CursorInfo.SF->getASTContext().LangOpts.EnableExperimentalConcurrency)
|
||||
return false;
|
||||
|
||||
// Currently doesn't check that the call is in an async context. This seems
|
||||
// possibly useful in some situations, so we'll see what the feedback is.
|
||||
// May need to change in the future
|
||||
@@ -5263,9 +5260,6 @@ bool RefactoringActionConvertToAsync::isApplicable(
|
||||
const ResolvedCursorInfo &CursorInfo, DiagnosticEngine &Diag) {
|
||||
using namespace asyncrefactorings;
|
||||
|
||||
if (!CursorInfo.SF->getASTContext().LangOpts.EnableExperimentalConcurrency)
|
||||
return false;
|
||||
|
||||
// As with the call refactoring, should possibly only apply if there's
|
||||
// actually calls to async alternatives. At the moment this will just add
|
||||
// `async` if there are no calls, which is probably fine.
|
||||
@@ -5295,9 +5289,6 @@ bool RefactoringActionAddAsyncAlternative::isApplicable(
|
||||
const ResolvedCursorInfo &CursorInfo, DiagnosticEngine &Diag) {
|
||||
using namespace asyncrefactorings;
|
||||
|
||||
if (!CursorInfo.SF->getASTContext().LangOpts.EnableExperimentalConcurrency)
|
||||
return false;
|
||||
|
||||
auto *FD = findFunction(CursorInfo);
|
||||
if (!FD)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user