Skip to content

Commit 668ecfa

Browse files
authored
Merge pull request #1418 from tshortli/deprecate-warn-on-potentially-unavailable-enum-case
Deprecate -warn-on-potentially-unavailable-enum-case option
2 parents 5378531 + 640c8d1 commit 668ecfa

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

-9
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,6 @@ extension Driver {
107107
commandLine.appendFlag("-aarch64-use-tbi")
108108
}
109109

110-
// Potentially unavailable enum cases are downgraded to a warning when building a
111-
// swiftmodule, to allow building a module (or module interface) for an older
112-
// deployment target than the framework itself.
113-
if isFrontendArgSupported(.warnOnPotentiallyUnavailableEnumCase) {
114-
if compilerOutputType == .swiftModule {
115-
commandLine.appendFlag(.warnOnPotentiallyUnavailableEnumCase)
116-
}
117-
}
118-
119110
// Enable or disable ObjC interop appropriately for the platform
120111
if targetTriple.isDarwin {
121112
commandLine.appendFlag(.enableObjcInterop)

Sources/SwiftOptions/Options.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ extension Option {
789789
public static let warnLongFunctionBodiesEQ: Option = Option("-warn-long-function-bodies=", .joined, alias: Option.warnLongFunctionBodies, attributes: [.helpHidden, .frontend, .noDriver])
790790
public static let warnLongFunctionBodies: Option = Option("-warn-long-function-bodies", .separate, attributes: [.helpHidden, .frontend, .noDriver], metaVar: "<n>", helpText: "Warns when type-checking a function takes longer than <n> ms")
791791
public static let warnOnEditorPlaceholder: Option = Option("-warn-on-editor-placeholder", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Downgrade the editor placeholder error to a warning")
792-
public static let warnOnPotentiallyUnavailableEnumCase: Option = Option("-warn-on-potentially-unavailable-enum-case", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Downgrade potential unavailability of enum case to a warning")
792+
public static let warnOnPotentiallyUnavailableEnumCase: Option = Option("-warn-on-potentially-unavailable-enum-case", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Deprecated, has no effect")
793793
public static let warnRedundantRequirements: Option = Option("-warn-redundant-requirements", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Emit warnings for redundant requirements in generic signatures")
794794
public static let warnSwift3ObjcInferenceComplete: Option = Option("-warn-swift3-objc-inference-complete", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Warn about deprecated @objc inference in Swift 3 for every declaration that will no longer be inferred as @objc in Swift 4")
795795
public static let warnSwift3ObjcInferenceMinimal: Option = Option("-warn-swift3-objc-inference-minimal", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Warn about deprecated @objc inference in Swift 3 based on direct uses of the Objective-C entrypoint")

Tests/SwiftDriverTests/SwiftDriverTests.swift

+4-5
Original file line numberDiff line numberDiff line change
@@ -3552,12 +3552,11 @@ final class SwiftDriverTests: XCTestCase {
35523552

35533553
if driver.targetTriple.isMacOSX {
35543554
let sdkIdx = try XCTUnwrap(job.commandLine.firstIndex(of: .flag("-sdk")))
3555-
let sdkPathOpt: VirtualPath? = switch job.commandLine[sdkIdx + 1] {
3556-
case .path(let path): path
3557-
default: nil
3555+
if case .path(let path) = job.commandLine[sdkIdx + 1] {
3556+
XCTAssertTrue(path.name.contains("MacOSX.platform"))
3557+
} else {
3558+
XCTFail("Missing SDK path")
35583559
}
3559-
let sdkPath = try XCTUnwrap(sdkPathOpt)
3560-
XCTAssertTrue(sdkPath.name.contains("MacOSX.platform"))
35613560
}
35623561

35633562
XCTAssertFalse(job.commandLine.contains(.flag("--")))

0 commit comments

Comments
 (0)