@@ -1231,9 +1231,8 @@ bool Decl::preconcurrency() const {
12311231
12321232 // Variables declared in top-level code are @_predatesConcurrency
12331233 if (const VarDecl *var = dyn_cast<VarDecl>(this )) {
1234- const LangOptions &langOpts = getASTContext ().LangOpts ;
1235- return !langOpts.isSwiftVersionAtLeast (6 ) && var->isTopLevelGlobal () &&
1236- var->getDeclContext ()->isAsyncContext ();
1234+ return !getASTContext ().isLanguageModeAtLeast (6 ) &&
1235+ var->isTopLevelGlobal () && var->getDeclContext ()->isAsyncContext ();
12371236 }
12381237
12391238 return false ;
@@ -2835,7 +2834,7 @@ static bool isDefaultInitializable(const TypeRepr *typeRepr, ASTContext &ctx) {
28352834 return true ;
28362835
28372836 // Also support the desugared 'Optional<T>' spelling.
2838- if (!ctx.isSwiftVersionAtLeast (5 )) {
2837+ if (!ctx.isLanguageModeAtLeast (5 )) {
28392838 if (typeRepr->isSimpleUnqualifiedIdentifier (ctx.Id_Void )) {
28402839 return true ;
28412840 }
@@ -3016,7 +3015,7 @@ static bool deferMatchesEnclosingAccess(const FuncDecl *defer) {
30163015 assert (defer->isDeferBody ());
30173016
30183017 // In Swift 6+, then yes.
3019- if (defer->getASTContext ().isSwiftVersionAtLeast (6 ))
3018+ if (defer->getASTContext ().isLanguageModeAtLeast (6 ))
30203019 return true ;
30213020
30223021 // If the defer is part of a function that is a member of an actor or
@@ -3090,7 +3089,7 @@ static bool isDirectToStorageAccess(const DeclContext *UseDC,
30903089 // In Swift 5 and later, the access must also be a member access on 'self'.
30913090 if (!isAccessOnSelf &&
30923091 var->getDeclContext ()->isTypeContext () &&
3093- var->getASTContext ().isSwiftVersionAtLeast (5 ))
3092+ var->getASTContext ().isLanguageModeAtLeast (5 ))
30943093 return false ;
30953094
30963095 // As a special case, 'read' and 'modify' coroutines with forced static
@@ -4058,7 +4057,7 @@ bool swift::conflicting(ASTContext &ctx,
40584057 // Prior to Swift 5, we permitted redeclarations of variables as different
40594058 // declarations if the variable was declared in an extension of a generic
40604059 // type. Make sure we maintain this behaviour in versions < 5.
4061- if (!ctx.isSwiftVersionAtLeast (5 )) {
4060+ if (!ctx.isLanguageModeAtLeast (5 )) {
40624061 if ((sig1.IsVariable && sig1.InExtensionOfGenericType ) ||
40634062 (sig2.IsVariable && sig2.InExtensionOfGenericType )) {
40644063 if (wouldConflictInSwift5)
@@ -4082,7 +4081,7 @@ bool swift::conflicting(ASTContext &ctx,
40824081 // Swift 5, a variable not in an extension of a generic type got a null
40834082 // overload type instead of a function type as it does now, so we really
40844083 // follow that behaviour and warn if there's going to be a conflict in future.
4085- if (!ctx.isSwiftVersionAtLeast (5 )) {
4084+ if (!ctx.isLanguageModeAtLeast (5 )) {
40864085 auto swift4Sig1Type = sig1.IsVariable && !sig1.InExtensionOfGenericType
40874086 ? CanType ()
40884087 : sig1Type;
@@ -12207,8 +12206,8 @@ ActorIsolation swift::getActorIsolationOfContext(
1220712206 if (dcToUse->isAsyncContext () ||
1220812207 ctx.LangOpts .StrictConcurrencyLevel >= StrictConcurrency::Complete) {
1220912208 if (Type mainActor = ctx.getMainActorType ())
12210- return ActorIsolation::forGlobalActor (mainActor)
12211- . withPreconcurrency ( !ctx.isSwiftVersionAtLeast (6 ));
12209+ return ActorIsolation::forGlobalActor (mainActor). withPreconcurrency (
12210+ !ctx.isLanguageModeAtLeast (6 ));
1221212211 }
1221312212 }
1221412213
0 commit comments