33// Enums with a CodingKeys entity which is not a type should not derive
44// conformance.
55enum InvalidCodingKeys1 : Codable { // expected-error {{type 'InvalidCodingKeys1' does not conform to protocol 'Decodable'}}
6- // expected-error@-1 {{type 'InvalidCodingKeys1' does not conform to protocol 'Encodable'}}
6+ // expected-error@-1 {{type 'InvalidCodingKeys1' does not conform to protocol 'Encodable'}}
7+ // expected-error@-2 {{cannot automatically synthesize 'Encodable' conformance for empty enum 'InvalidCodingKeys1'}}
8+ // expected-error@-3 {{cannot automatically synthesize 'Decodable' conformance for empty enum 'InvalidCodingKeys1'}}
79 static let CodingKeys = 5 // expected-note {{cannot automatically synthesize 'Decodable' because 'CodingKeys' is not an enum}}
810 // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'CodingKeys' is not an enum}}
911}
@@ -12,6 +14,8 @@ enum InvalidCodingKeys1 : Codable { // expected-error {{type 'InvalidCodingKeys1
1214// not derive conformance.
1315enum InvalidCodingKeys2 : Codable { // expected-error {{type 'InvalidCodingKeys2' does not conform to protocol 'Decodable'}}
1416 // expected-error@-1 {{type 'InvalidCodingKeys2' does not conform to protocol 'Encodable'}}
17+ // expected-error@-2 {{cannot automatically synthesize 'Encodable' conformance for empty enum 'InvalidCodingKeys2'}}
18+ // expected-error@-3 {{cannot automatically synthesize 'Decodable' conformance for empty enum 'InvalidCodingKeys2'}}
1519 enum CodingKeys { } // expected-note {{cannot automatically synthesize 'Decodable' because 'CodingKeys' does not conform to CodingKey}}
1620 // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'CodingKeys' does not conform to CodingKey}}
1721}
@@ -20,6 +24,8 @@ enum InvalidCodingKeys2 : Codable { // expected-error {{type 'InvalidCodingKeys2
2024// conformance.
2125enum InvalidCodingKeys3 : Codable { // expected-error {{type 'InvalidCodingKeys3' does not conform to protocol 'Decodable'}}
2226 // expected-error@-1 {{type 'InvalidCodingKeys3' does not conform to protocol 'Encodable'}}
27+ // expected-error@-2 {{cannot automatically synthesize 'Decodable' conformance for empty enum 'InvalidCodingKeys3'}}
28+ // expected-error@-3 {{cannot automatically synthesize 'Encodable' conformance for empty enum 'InvalidCodingKeys3'}}
2329 struct CodingKeys : CodingKey { // expected-note {{cannot automatically synthesize 'Decodable' because 'CodingKeys' is not an enum}}
2430 // expected-note@-1 {{cannot automatically synthesize 'Encodable' because 'CodingKeys' is not an enum}}
2531 var stringValue : String
0 commit comments