Skip to content

Keep cleaning up after AnyHashable #3850

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

Merged
merged 1 commit into from
Jul 29, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion validation-test/stdlib/AnyHashable.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ AnyHashableTests.test("AnyHashable containing _SwiftNativeNSError") {
expectEqual(
.objCClassWrapper,
SwiftRuntime.metadataKind(of: nsErrors.first!))
expectEqual("_SwiftNativeNSError", String(nsErrors[0].dynamicType))
expectEqual("_SwiftNativeNSError", String(describing: nsErrors[0].dynamicType))
checkHashable(nsErrors, equalityOracle: { $0 / 2 == $1 / 2 })
checkHashable(
nsErrors.map(AnyHashable.init),
Expand Down
6 changes: 3 additions & 3 deletions validation-test/stdlib/NSDecimalNumberBridging.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ NSDecimalNumberTests.test("AnyHashable containing Foundation.Decimal") {
NSDecimalNumber(string: "20.0"),
]
let anyHashables = values.map(AnyHashable.init)
expectEqual("Decimal", String(anyHashables[0].base.dynamicType))
expectEqual("Decimal", String(anyHashables[1].base.dynamicType))
expectEqual("Decimal", String(anyHashables[2].base.dynamicType))
expectEqual("Decimal", String(describing: anyHashables[0].base.dynamicType))
expectEqual("Decimal", String(describing: anyHashables[1].base.dynamicType))
expectEqual("Decimal", String(describing: anyHashables[2].base.dynamicType))
expectNotEqual(anyHashables[0], anyHashables[1])
expectEqual(anyHashables[1], anyHashables[2])
}
Expand Down
8 changes: 4 additions & 4 deletions validation-test/stdlib/NSNumberBridging.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ NSNumberTests.test("_SwiftTypePreservingNSNumber.classForCoder") {
// Check that internal subclass is not achived.
let n: NSNumber = (42 as Int)._bridgeToObjectiveC()
expectTrue(isTypePreservingNSNumber(n))
expectEqual("NSNumber", String(n.classForCoder))
expectEqual("NSNumber", String(n.classForKeyedArchiver!))
expectEqual("NSNumber", String(describing: n.classForCoder))
expectEqual("NSNumber", String(describing: n.classForKeyedArchiver!))
}

NSNumberTests.test("_SwiftTypePreservingNSNumber.init(coder:)")
Expand Down Expand Up @@ -261,11 +261,11 @@ NSNumberTests.test("${Self} bridges to NSNumber (actually _SwiftTypePreservingNS
expectEmpty(explicitNSNumber._toCustomAnyHashable())
expectTrue(
Set(["__NSCFNumber", "__NSCFBoolean"]).contains(
String(AnyHashable(explicitNSNumber).base.dynamicType)))
String(describing: AnyHashable(explicitNSNumber).base.dynamicType)))
expectEqual(AnyHashable(explicitNSNumber), AnyHashable(explicitNSNumber))

let ah = AnyHashable(bridgedNSNumber)
expectEqual("${Self}", String(ah.base.dynamicType))
expectEqual("${Self}", String(describing: ah.base.dynamicType))
% if Self in ['Float', 'Double', 'CGFloat']:
// FIXME: remove special cases for floating point when we fix their
// conformances to Equatable.
Expand Down
6 changes: 3 additions & 3 deletions validation-test/stdlib/NSStringBridging.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ NSStringTests.test("NSString bridges to String with custom AnyHashable")
input in
let s = input._bridgeToObjectiveC()
expectNotEmpty(s._toCustomAnyHashable())
expectEqual("String", String(AnyHashable(s).base.dynamicType))
expectEqual("String", String(describing: AnyHashable(s).base.dynamicType))
}

NSStringTests.test("AnyHashable(NSString) uses Swift String comparison rules") {
Expand All @@ -29,8 +29,8 @@ NSStringTests.test("AnyHashable(NSString) uses Swift String comparison rules") {
let nss2: NSString = NSString(utf8String: "\u{e1}")!
let ah1 = AnyHashable(nss1)
let ah2 = AnyHashable(nss2)
expectEqual("String", String(ah1.base.dynamicType))
expectEqual("String", String(ah2.base.dynamicType))
expectEqual("String", String(describing: ah1.base.dynamicType))
expectEqual("String", String(describing: ah2.base.dynamicType))
checkHashable([ah1, ah2], equalityOracle: { _ in true })
}

Expand Down
2 changes: 1 addition & 1 deletion validation-test/stdlib/Unicode.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ StringTests.test("StreamableConformance") {
forStringsWithUnpairedSurrogates {
(test: UTF16Test, subject: String) -> Void in
let expected = test.scalarsHead + test.scalarsRepairedTail
let printedSubject = String(subject)
let printedSubject = subject
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the point of this test was to test the Streamable conformance of String. Now this test does nothing...

let actual = printedSubject.unicodeScalars.map { $0.value }
expectEqual(expected, actual)
}
Expand Down