[Features] Rename the BuiltinBuildTaskExecutor
feature guard.
#71599
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The name of the
TaskExecutor
protocol was recently changed in #71145 to remove underscores after the task executor preference proposal was accepted in Swift Evolution. An implication of that rename is that thebuildOrdinaryTaskExecutorRef
builtin changed the type that it expected as the argument. However, the original_TaskExecutor
protocol landed in the _Concurrency library which as since produced.swiftinterface
files that contain the following@inlinable
code:When a compiler containing the
TaskExecutor
protocol rename attempts to type check the above@inlinable
code when rebuilding the _Concurrency module from its.swiftinterface
file, it crashes because the builtin is expecting an argument conforming toTaskExecutor
, which doesn't exist in this version of the standard library. Specifically, the crash happens here:The issue is that the current compiler still supports the
$BuiltinBuildTaskExecutor
feature guard, and thus attempts to typecheckself.executor = Builtin.buildOrdinaryTaskExecutorRef(executor)
, but the type ofexecutor
conforms to_TaskExecutor
instead ofTaskExecutor
. BecauseTaskExecutor
doesn't exist in this version of the _Concurrency library,SC.Context.getProtocol(KnownProtocolKind::TaskExecutor)
returnsnullptr
.To resolve this issue, we need to stop supporting the
$BuiltinBuildTaskExecutor
feature guard and introduce a new one that is only supported by compiler versions that contain theTaskExecutor
rename. This approach relies on nothing having adopted the API, otherwise we would need to stage in the rename as a parallel set of APIs, and only remove the old APIs once nothing is relying on the old _Concurrency.swiftinterface
files. With this rename of the feature guard, compilers type checking older_Concurrency.swiftinterface
files will behave as if they do not support the feature, and thus will not attempt to type check the code guarded by#if $BuiltinBuildTaskExecutor
.