@@ -4219,11 +4219,6 @@ NeverNullType TypeResolver::resolveASTFunctionType(
42194219 attr->getAttrName ());
42204220 }
42214221
4222- if (options.contains (TypeResolutionFlags::InheritsActorContext)) {
4223- diagnoseInvalid (repr, attr->getAttrLoc (),
4224- diag::inherit_actor_context_with_concurrent, attr);
4225- }
4226-
42274222 switch (isolation.getKind ()) {
42284223 case FunctionTypeIsolation::Kind::NonIsolated:
42294224 break ;
@@ -4270,20 +4265,18 @@ NeverNullType TypeResolver::resolveASTFunctionType(
42704265 if (!repr->isInvalid ())
42714266 isolation = FunctionTypeIsolation::forNonIsolated ();
42724267 } else if (!getWithoutClaiming<CallerIsolatedTypeRepr>(attrs)) {
4273- if (!options.contains (TypeResolutionFlags::InheritsActorContext)) {
4274- // Infer async function type as `nonisolated(nonsending)` if there is
4275- // no `@concurrent` or `nonisolated(nonsending)` attribute and isolation
4276- // is nonisolated.
4277- if (ctx.LangOpts .hasFeature (Feature::NonisolatedNonsendingByDefault) &&
4278- repr->isAsync () && isolation.isNonIsolated ()) {
4279- isolation = FunctionTypeIsolation::forNonIsolatedCaller ();
4280- } else if (ctx.LangOpts
4281- .getFeatureState (Feature::NonisolatedNonsendingByDefault)
4282- .isEnabledForMigration ()) {
4283- // Diagnose only in the interface stage, which is run once.
4284- if (inStage (TypeResolutionStage::Interface)) {
4285- warnAboutNewNonisolatedAsyncExecutionBehavior (ctx, repr, isolation);
4286- }
4268+ // Infer async function type as `nonisolated(nonsending)` if there is
4269+ // no `@concurrent` or `nonisolated(nonsending)` attribute and isolation
4270+ // is nonisolated.
4271+ if (ctx.LangOpts .hasFeature (Feature::NonisolatedNonsendingByDefault) &&
4272+ repr->isAsync () && isolation.isNonIsolated ()) {
4273+ isolation = FunctionTypeIsolation::forNonIsolatedCaller ();
4274+ } else if (ctx.LangOpts
4275+ .getFeatureState (Feature::NonisolatedNonsendingByDefault)
4276+ .isEnabledForMigration ()) {
4277+ // Diagnose only in the interface stage, which is run once.
4278+ if (inStage (TypeResolutionStage::Interface)) {
4279+ warnAboutNewNonisolatedAsyncExecutionBehavior (ctx, repr, isolation);
42874280 }
42884281 }
42894282 }
@@ -5333,12 +5326,6 @@ TypeResolver::resolveCallerIsolatedTypeRepr(CallerIsolatedTypeRepr *repr,
53335326 return ErrorType::get (getASTContext ());
53345327 }
53355328
5336- if (options.contains (TypeResolutionFlags::InheritsActorContext)) {
5337- diagnoseInvalid (repr, repr->getLoc (),
5338- diag::inherit_actor_context_with_nonisolated_nonsending,
5339- repr);
5340- }
5341-
53425329 if (!fnType->isAsync ()) {
53435330 diagnoseInvalid (repr, repr->getStartLoc (),
53445331 diag::nonisolated_nonsending_only_on_async, repr);
0 commit comments