Skip to content

Commit 06dbb6f

Browse files
authored
Merge pull request #384 from nkcsgexi/71942877
Accept none as the value for -runtime-compatibility-version
2 parents 2cf731b + 2ec878a commit 06dbb6f

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
@@ -2084,7 +2084,8 @@ extension Driver {
20842084
if let version = SwiftVersion(string: versionString) {
20852085
info.target.swiftRuntimeCompatibilityVersion = version
20862086
info.targetVariant?.swiftRuntimeCompatibilityVersion = version
2087-
} else {
2087+
} else if (versionString != "none") {
2088+
// "none" was accepted by the old driver, diagnose other values.
20882089
diagnosticsEngine.emit(
20892090
.error_invalid_arg_value(
20902091
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)