Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate -warn-on-potentially-unavailable-enum-case option #1418

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ extension Driver {
commandLine.appendFlag("-aarch64-use-tbi")
}

// Potentially unavailable enum cases are downgraded to a warning when building a
// swiftmodule, to allow building a module (or module interface) for an older
// deployment target than the framework itself.
if isFrontendArgSupported(.warnOnPotentiallyUnavailableEnumCase) {
if compilerOutputType == .swiftModule {
commandLine.appendFlag(.warnOnPotentiallyUnavailableEnumCase)
}
}

// Enable or disable ObjC interop appropriately for the platform
if targetTriple.isDarwin {
commandLine.appendFlag(.enableObjcInterop)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftOptions/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ extension Option {
public static let warnLongFunctionBodiesEQ: Option = Option("-warn-long-function-bodies=", .joined, alias: Option.warnLongFunctionBodies, attributes: [.helpHidden, .frontend, .noDriver])
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")
public static let warnOnEditorPlaceholder: Option = Option("-warn-on-editor-placeholder", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Downgrade the editor placeholder error to a warning")
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")
public static let warnOnPotentiallyUnavailableEnumCase: Option = Option("-warn-on-potentially-unavailable-enum-case", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Deprecated, has no effect")
public static let warnRedundantRequirements: Option = Option("-warn-redundant-requirements", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Emit warnings for redundant requirements in generic signatures")
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")
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")
Expand Down
9 changes: 4 additions & 5 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3552,12 +3552,11 @@ final class SwiftDriverTests: XCTestCase {

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

XCTAssertFalse(job.commandLine.contains(.flag("--")))
Expand Down