Skip to content

Commit 2ec878a

Browse files
committed
Accept none as the value for -runtime-compatibility-version
rdar://71942877
1 parent aa87d8d commit 2ec878a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,8 @@ extension Driver {
20822082
if let version = SwiftVersion(string: versionString) {
20832083
info.target.swiftRuntimeCompatibilityVersion = version
20842084
info.targetVariant?.swiftRuntimeCompatibilityVersion = version
2085-
} else {
2085+
} else if (versionString != "none") {
2086+
// "none" was accepted by the old driver, diagnose other values.
20862087
diagnosticsEngine.emit(
20872088
.error_invalid_arg_value(
20882089
arg: .runtimeCompatibilityVersion, value: versionString))

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ final class SwiftDriverTests: XCTestCase {
219219
}
220220
#endif
221221

222+
func testRuntimeCompatibilityVersion() throws {
223+
try assertNoDriverDiagnostics(args: "swiftc", "a.swift", "-runtime-compatibility-version", "none")
224+
}
225+
222226
func testInputFiles() throws {
223227
let driver1 = try Driver(args: ["swiftc", "a.swift", "/tmp/b.swift"])
224228
XCTAssertEqual(driver1.inputFiles,

0 commit comments

Comments
 (0)