Skip to content

Commit e3623cc

Browse files
committed
Remove warnings from TestJSONEncoder compilation.
Since the introduction of #26357/SR-11160 the TestJSONEncoder seems to have been emitting the new warnings related to tuples being incorrectly pattern matched. The changes remove the incorrect code (removing the parenthesis around the pattern). Should not have any other effect (and the effect was not normally visible if the test was successful, anyway).
1 parent 8a03fde commit e3623cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Darwin/Foundation-swiftoverlay-Tests/TestJSONEncoder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
669669
encoder.keyEncodingStrategy = .convertToSnakeCase
670670
do {
671671
_ = try encoder.encode(toEncode)
672-
} catch EncodingError.invalidValue(let (_, context)) {
672+
} catch EncodingError.invalidValue(_, let context) {
673673
expectEqual(2, context.codingPath.count)
674674
expectEqual("key", context.codingPath[0].stringValue)
675675
expectEqual("someValue", context.codingPath[1].stringValue)
@@ -685,7 +685,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
685685
encoder.keyEncodingStrategy = .convertToSnakeCase
686686
do {
687687
_ = try encoder.encode(toEncode)
688-
} catch EncodingError.invalidValue(let (_, context)) {
688+
} catch EncodingError.invalidValue(_, let context) {
689689
expectEqual(4, context.codingPath.count)
690690
expectEqual("key", context.codingPath[0].stringValue)
691691
expectEqual("sub_key", context.codingPath[1].stringValue)
@@ -838,7 +838,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
838838
decoder.keyDecodingStrategy = .convertFromSnakeCase
839839
do {
840840
_ = try decoder.decode([String: Int].self, from: input)
841-
} catch DecodingError.typeMismatch(let (_, context)) {
841+
} catch DecodingError.typeMismatch(_, let context) {
842842
expectEqual(1, context.codingPath.count)
843843
expectEqual("leave_me_alone", context.codingPath[0].stringValue)
844844
} catch {
@@ -860,7 +860,7 @@ class TestJSONEncoder : TestJSONEncoderSuper {
860860
decoder.keyDecodingStrategy = .convertFromSnakeCase
861861
do {
862862
_ = try decoder.decode([String: [String : DecodeFailureNested]].self, from: input)
863-
} catch DecodingError.typeMismatch(let (_, context)) {
863+
} catch DecodingError.typeMismatch(_, let context) {
864864
expectEqual(4, context.codingPath.count)
865865
expectEqual("top_level", context.codingPath[0].stringValue)
866866
expectEqual("sub_level", context.codingPath[1].stringValue)

0 commit comments

Comments
 (0)