[Sema] Implement validation of @execution(...) in type context

This commit is contained in:
Pavel Yaskevich
2025-02-05 10:11:38 -08:00
parent 84fb4967cb
commit aad858d66c
5 changed files with 112 additions and 7 deletions

View File

@@ -8257,10 +8257,14 @@ ERROR(attr_abi_incompatible_with_silgen_name,none,
// MARK: @execution Attribute
//===----------------------------------------------------------------------===//
ERROR(attr_execution_concurrent_only_on_async,none,
"cannot use '@execution(concurrent)' on non-async %kind0",
ERROR(attr_execution_only_on_async,none,
"cannot use '@execution' on non-async %kind0",
(ValueDecl *))
ERROR(attr_execution_type_attr_only_on_async,none,
"cannot use '@execution' on non-async function type",
())
ERROR(attr_execution_concurrent_incompatible_isolated_parameter,none,
"cannot use '@execution(concurrent)' on %kind0 because it has "
"an isolated parameter: %1",
@@ -8276,6 +8280,19 @@ ERROR(attr_execution_concurrent_incompatible_with_nonisolated,none,
"because they serve the same purpose",
(ValueDecl *))
ERROR(attr_execution_concurrent_type_attr_incompatible_with_global_isolation,none,
"cannot use '@execution(concurrent)' because function type is "
"isolated to global actor %0",
(Type))
ERROR(attr_execution_concurrent_type_attr_incompatible_with_isolated_param,none,
"cannot use '@execution(concurrent)' together with isolated parameter",
())
ERROR(attr_execution_concurrent_type_attr_incompatible_with_isolated_any,none,
"cannot use '@execution(concurrent)' together with @isolated(any)",
())
#define UNDEFINE_DIAGNOSTIC_MACROS
#include "DefineDiagnosticMacros.h"