@@ -4219,11 +4219,6 @@ NeverNullType TypeResolver::resolveASTFunctionType(
4219
4219
attr->getAttrName ());
4220
4220
}
4221
4221
4222
- if (options.contains (TypeResolutionFlags::InheritsActorContext)) {
4223
- diagnoseInvalid (repr, attr->getAttrLoc (),
4224
- diag::inherit_actor_context_with_concurrent, attr);
4225
- }
4226
-
4227
4222
switch (isolation.getKind ()) {
4228
4223
case FunctionTypeIsolation::Kind::NonIsolated:
4229
4224
break ;
@@ -4270,20 +4265,18 @@ NeverNullType TypeResolver::resolveASTFunctionType(
4270
4265
if (!repr->isInvalid ())
4271
4266
isolation = FunctionTypeIsolation::forNonIsolated ();
4272
4267
} 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);
4287
4280
}
4288
4281
}
4289
4282
}
@@ -5333,12 +5326,6 @@ TypeResolver::resolveCallerIsolatedTypeRepr(CallerIsolatedTypeRepr *repr,
5333
5326
return ErrorType::get (getASTContext ());
5334
5327
}
5335
5328
5336
- if (options.contains (TypeResolutionFlags::InheritsActorContext)) {
5337
- diagnoseInvalid (repr, repr->getLoc (),
5338
- diag::inherit_actor_context_with_nonisolated_nonsending,
5339
- repr);
5340
- }
5341
-
5342
5329
if (!fnType->isAsync ()) {
5343
5330
diagnoseInvalid (repr, repr->getStartLoc (),
5344
5331
diag::nonisolated_nonsending_only_on_async, repr);
0 commit comments