Skip to content

Remove warnings from TestJSONEncoder compilation. #27044

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
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
8 changes: 4 additions & 4 deletions test/stdlib/TestJSONEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
encoder.keyEncodingStrategy = .convertToSnakeCase
do {
_ = try encoder.encode(toEncode)
} catch EncodingError.invalidValue(let (_, context)) {
} catch EncodingError.invalidValue(_, let context) {
expectEqual(2, context.codingPath.count)
expectEqual("key", context.codingPath[0].stringValue)
expectEqual("someValue", context.codingPath[1].stringValue)
Expand All @@ -685,7 +685,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
encoder.keyEncodingStrategy = .convertToSnakeCase
do {
_ = try encoder.encode(toEncode)
} catch EncodingError.invalidValue(let (_, context)) {
} catch EncodingError.invalidValue(_, let context) {
expectEqual(4, context.codingPath.count)
expectEqual("key", context.codingPath[0].stringValue)
expectEqual("sub_key", context.codingPath[1].stringValue)
Expand Down Expand Up @@ -838,7 +838,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
decoder.keyDecodingStrategy = .convertFromSnakeCase
do {
_ = try decoder.decode([String: Int].self, from: input)
} catch DecodingError.typeMismatch(let (_, context)) {
} catch DecodingError.typeMismatch(_, let context) {
expectEqual(1, context.codingPath.count)
expectEqual("leave_me_alone", context.codingPath[0].stringValue)
} catch {
Expand All @@ -860,7 +860,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
decoder.keyDecodingStrategy = .convertFromSnakeCase
do {
_ = try decoder.decode([String: [String : DecodeFailureNested]].self, from: input)
} catch DecodingError.typeMismatch(let (_, context)) {
} catch DecodingError.typeMismatch(_, let context) {
expectEqual(4, context.codingPath.count)
expectEqual("top_level", context.codingPath[0].stringValue)
expectEqual("sub_level", context.codingPath[1].stringValue)
Expand Down