Skip to content

Commit 45e5b50

Browse files
committed
[Concurrency] Remove experimental @task macro
In order to avoid confusion about it in 6.2, we should remove this. We can revisit and bring it back in the future if necessary
1 parent 31a9b79 commit 45e5b50

File tree

6 files changed

+1
-331
lines changed

6 files changed

+1
-331
lines changed

lib/Macros/Sources/SwiftMacros/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ add_swift_macro_library(SwiftMacros
1414
OptionSetMacro.swift
1515
DebugDescriptionMacro.swift
1616
DistributedResolvableMacro.swift
17-
TaskMacro.swift
1817
SyntaxExtensions.swift
1918
TaskLocalMacro.swift
2019
SwiftifyImportMacro.swift

lib/Macros/Sources/SwiftMacros/SyntaxExtensions.swift

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,4 @@ extension ImplicitlyUnwrappedOptionalTypeSyntax {
4343
trailingTrivia: self.trailingTrivia
4444
)
4545
}
46-
}
47-
48-
extension LabeledExprListSyntax {
49-
/// Retrieve the first element with the given label.
50-
func first(labeled name: String) -> Element? {
51-
return first { element in
52-
if let label = element.label, label.text == name {
53-
return true
54-
}
55-
56-
return false
57-
}
58-
}
59-
}
46+
}

lib/Macros/Sources/SwiftMacros/TaskMacro.swift

Lines changed: 0 additions & 126 deletions
This file was deleted.

lib/Sema/TypeCheckMacros.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,18 +1902,6 @@ ExpandBodyMacroRequest::evaluate(Evaluator &evaluator,
19021902
if (bufferID)
19031903
return;
19041904

1905-
// '@Task' is gated behind the 'ConcurrencySyntaxSugar'
1906-
// experimental feature.
1907-
if (macro->getParentModule()->getName().is("_Concurrency") &&
1908-
macro->getBaseIdentifier().is("Task") &&
1909-
!ctx.LangOpts.hasFeature(Feature::ConcurrencySyntaxSugar)) {
1910-
ctx.Diags.diagnose(
1911-
customAttr->getLocation(),
1912-
diag::experimental_macro,
1913-
macro->getName());
1914-
return;
1915-
}
1916-
19171905
SourceFile * macroSourceFile = nullptr;
19181906
if (auto *fnDecl = fn.getAbstractFunctionDecl()) {
19191907
macroSourceFile = ::evaluateAttachedMacro(

stdlib/public/Concurrency/Actor.swift

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,27 +99,6 @@ internal func _enqueueOnMain(_ job: UnownedJob)
9999
@freestanding(expression)
100100
public macro isolation<T>() -> T = Builtin.IsolationMacro
101101

102-
/// Wrap the function body in a new top-level task on behalf of the
103-
/// given actor.
104-
@available(SwiftStdlib 5.1, *)
105-
@attached(body)
106-
public macro Task(
107-
on actor: any GlobalActor,
108-
name: String? = nil,
109-
priority: TaskPriority? = nil
110-
) =
111-
#externalMacro(module: "SwiftMacros", type: "TaskMacro")
112-
113-
/// Wrap the function body in a new top-level task on behalf of the
114-
/// current actor.
115-
@available(SwiftStdlib 5.1, *)
116-
@attached(body)
117-
public macro Task(
118-
name: String? = nil,
119-
priority: TaskPriority? = nil
120-
) =
121-
#externalMacro(module: "SwiftMacros", type: "TaskMacro")
122-
123102
#endif
124103

125104
#if $IsolatedAny

test/Macros/task_macro.swift

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)