@@ -4203,35 +4203,37 @@ NeverNullType TypeResolver::resolveASTFunctionType(
4203
4203
diag::attr_execution_type_attr_only_on_async);
4204
4204
}
4205
4205
4206
- switch (isolation.getKind ()) {
4207
- case FunctionTypeIsolation::Kind::NonIsolated:
4208
- break ;
4209
-
4210
- case FunctionTypeIsolation::Kind::GlobalActor:
4211
- diagnoseInvalid (
4212
- repr, executionAttr->getAtLoc (),
4213
- diag::
4214
- attr_execution_concurrent_type_attr_incompatible_with_global_isolation,
4215
- isolation.getGlobalActorType ());
4216
- break ;
4206
+ if (executionAttr->getBehavior () == ExecutionKind::Concurrent) {
4207
+ switch (isolation.getKind ()) {
4208
+ case FunctionTypeIsolation::Kind::NonIsolated:
4209
+ break ;
4217
4210
4218
- case FunctionTypeIsolation::Kind::Parameter:
4219
- diagnoseInvalid (
4220
- repr, executionAttr->getAtLoc (),
4221
- diag::
4222
- attr_execution_concurrent_type_attr_incompatible_with_isolated_param);
4223
- break ;
4211
+ case FunctionTypeIsolation::Kind::GlobalActor:
4212
+ diagnoseInvalid (
4213
+ repr, executionAttr->getAtLoc (),
4214
+ diag::
4215
+ attr_execution_concurrent_type_attr_incompatible_with_global_isolation,
4216
+ isolation.getGlobalActorType ());
4217
+ break ;
4224
4218
4225
- case FunctionTypeIsolation::Kind::Erased :
4226
- diagnoseInvalid (
4227
- repr, executionAttr->getAtLoc (),
4228
- diag::
4229
- attr_execution_concurrent_type_attr_incompatible_with_isolated_any );
4230
- break ;
4219
+ case FunctionTypeIsolation::Kind::Parameter :
4220
+ diagnoseInvalid (
4221
+ repr, executionAttr->getAtLoc (),
4222
+ diag::
4223
+ attr_execution_concurrent_type_attr_incompatible_with_isolated_param );
4224
+ break ;
4231
4225
4232
- case FunctionTypeIsolation::Kind::NonIsolatedCaller:
4233
- llvm_unreachable (" cannot happen because multiple @execution attributes "
4234
- " aren't allowed." );
4226
+ case FunctionTypeIsolation::Kind::Erased:
4227
+ diagnoseInvalid (
4228
+ repr, executionAttr->getAtLoc (),
4229
+ diag::
4230
+ attr_execution_concurrent_type_attr_incompatible_with_isolated_any);
4231
+ break ;
4232
+
4233
+ case FunctionTypeIsolation::Kind::NonIsolatedCaller:
4234
+ llvm_unreachable (" cannot happen because multiple @execution attributes "
4235
+ " aren't allowed." );
4236
+ }
4235
4237
}
4236
4238
4237
4239
if (!repr->isInvalid ()) {
0 commit comments