Skip to content

Commit 19ff4a1

Browse files
authored
Merge pull request #2746 from ahoppen/6.0/multithreadingtest-sendable
[6.0] Mark `MultithreadingTests` as `@unchecked Sendable` to work around rdar://130094927
2 parents 3470ac1 + 4c3a198 commit 19ff4a1

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Examples/Sources/MacroExamples/Playground/ExpressionMacrosPlayground.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func runExpressionMacrosPlayground() {
4747

4848
// let domain = "domain.com"
4949
//print(#URL("https://\(domain)/api/path")) // error: #URL requires a static string literal
50-
//print(#URL("https://not a url.com")) // error: Malformed url
50+
//print(#URL("https://not a url.com:invalid-port/")) // error: Malformed url
5151

5252
// MARK: - Warning
5353

Examples/Tests/MacroExamples/Implementation/Expression/URLMacroTests.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ final class URLMacroTests: XCTestCase {
2121
func testExpansionWithMalformedURLEmitsError() {
2222
assertMacroExpansion(
2323
"""
24-
let invalid = #URL("https://not a url.com")
24+
let invalid = #URL("https://not a url.com:invalid-port/")
2525
""",
2626
expandedSource: """
27-
let invalid = #URL("https://not a url.com")
27+
let invalid = #URL("https://not a url.com:invalid-port/")
2828
""",
2929
diagnostics: [
30-
DiagnosticSpec(message: #"malformed url: "https://not a url.com""#, line: 1, column: 15, severity: .error)
30+
DiagnosticSpec(
31+
message: #"malformed url: "https://not a url.com:invalid-port/""#,
32+
line: 1,
33+
column: 15,
34+
severity: .error
35+
)
3136
],
3237
macros: macros,
3338
indentationWidth: .spaces(2)

Tests/SwiftSyntaxTest/MultithreadingTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ extension SyntaxProtocol {
2020
}
2121
}
2222

23-
class MultithreadingTests: XCTestCase {
24-
23+
// Marked as `@unchecked Sendable` to work around rdar://130094927, which complains about `MultithreadingTests` not conforming to
24+
// `Sendable`.
25+
class MultithreadingTests: XCTestCase, @unchecked Sendable {
2526
public func testPathological() {
2627
let tuple = TupleTypeSyntax(
2728
leftParen: .leftParenToken(),

0 commit comments

Comments
 (0)