Skip to content

Commit e46929a

Browse files
committed
Work around some SE-0072 issues.
Without some overlay work, SE-0072 necessitates some ugly transitional casts. We can hopefully clean these up with followup compiler work.
1 parent 7ca7bcd commit e46929a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/swiftpm-xctest-helper/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func run() throws {
8080
throw Error.couldNotOpenOutputFile(outputFile)
8181
}
8282
// Create output dictionary.
83-
let output = ["name": "All Tests", "tests": testCases as NSArray] as NSDictionary
83+
let output = ["name" as NSString: "All Tests" as NSString, "tests" as NSString: testCases as NSArray] as NSDictionary
8484
// Convert output dictionary to JSON and write to output file.
8585
let outputData = try JSONSerialization.data(withJSONObject: output, options: .prettyPrinted)
8686
file.write(outputData)

Tests/FunctionalTests/SwiftPMXCTestHelperTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ class SwiftPMXCTestHelperTests: XCTestCase {
2727
"tests": [
2828
[
2929
"name": "ObjCTests",
30-
"tests": [["name": "test_example"], ["name": "testThisThing"]]
30+
"tests": [["name": "test_example"], ["name": "testThisThing"]] as Array<Dictionary<String, String>>
3131
],
3232
[
3333
"name": "SwiftPMXCTestHelperTests.SwiftPMXCTestHelperTests1",
34-
"tests": [["name": "test_Example2"], ["name": "testExample1"]]
34+
"tests": [["name": "test_Example2"], ["name": "testExample1"]] as Array<Dictionary<String, String>>
3535
]
36-
]]]
37-
] as NSDictionary
36+
] as Array<Dictionary<String, Any>>]] as Array<Dictionary<String, Any>>
37+
] as Dictionary<String, Any> as NSDictionary
3838
// Run the XCTest helper tool and check result.
3939
XCTAssertXCTestHelper(prefix.appending(components: ".build", "debug", "SwiftPMXCTestHelperTests.xctest"), testCases: testCases)
4040
}

0 commit comments

Comments
 (0)