mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 46a9f57329.
This broke Swift CI, OSS incremental RA:
./swift/stdlib/public/SDK/Foundation/TimeZone.swift:228:45: error: 'NSTimeZone' is not implicitly convertible to 'TimeZone'; did you mean to use 'as' to explicitly convert?
return lhs._wrapped.isEqual(to: rhs._wrapped)
This commit is contained in:
@@ -262,18 +262,22 @@ func expectLocalizedEquality(
|
||||
_ localeID: String? = nil,
|
||||
_ message: @autoclosure () -> String = "",
|
||||
showFrame: Bool = true,
|
||||
stackTrace: SourceLocStack = SourceLocStack(),
|
||||
stackTrace: SourceLocStack = SourceLocStack(),
|
||||
file: String = #file, line: UInt = #line
|
||||
) {
|
||||
let trace = stackTrace.pushIf(showFrame, file: file, line: line)
|
||||
|
||||
let locale = localeID.map {
|
||||
Locale(identifier: $0)
|
||||
Locale(localeIdentifier: $0)
|
||||
} ?? Locale.current
|
||||
|
||||
expectEqual(
|
||||
expected, op(locale),
|
||||
message(), stackTrace: trace)
|
||||
message(), stackTrace: trace)
|
||||
|
||||
expectEqual(
|
||||
op(Locale.system), op(nil),
|
||||
message(), stackTrace: trace)
|
||||
}
|
||||
|
||||
NSStringAPIs.test("capitalizedString(with:)") {
|
||||
@@ -830,6 +834,8 @@ NSStringAPIs.test("init(format:locale:_:...)") {
|
||||
var world: NSString = "world"
|
||||
expectEqual("Hello, world!%42", String(format: "Hello, %@!%%%ld",
|
||||
locale: nil, world, 42))
|
||||
expectEqual("Hello, world!%42", String(format: "Hello, %@!%%%ld",
|
||||
locale: Locale.system, world, 42))
|
||||
}
|
||||
|
||||
NSStringAPIs.test("init(format:locale:arguments:)") {
|
||||
@@ -837,6 +843,8 @@ NSStringAPIs.test("init(format:locale:arguments:)") {
|
||||
let args: [CVarArg] = [ world, 42 ]
|
||||
expectEqual("Hello, world!%42", String(format: "Hello, %@!%%%ld",
|
||||
locale: nil, arguments: args))
|
||||
expectEqual("Hello, world!%42", String(format: "Hello, %@!%%%ld",
|
||||
locale: Locale.system, arguments: args))
|
||||
}
|
||||
|
||||
NSStringAPIs.test("lastPathComponent") {
|
||||
|
||||
Reference in New Issue
Block a user