File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
test/decl/protocol/special/coding Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,21 @@ let _ = SimpleStruct.encode(to:)
29
29
// The synthesized CodingKeys type should not be accessible from outside the
30
30
// struct.
31
31
let _ = SimpleStruct . CodingKeys. self // expected-error {{'CodingKeys' is inaccessible due to 'private' protection level}}
32
+
33
+ // rdar://problem/59655704
34
+ struct SR_12248_1 : Codable { // expected-error {{type 'SR_12248_1' does not conform to protocol 'Encodable'}}
35
+ var x : Int // expected-note {{'x' previously declared here}}
36
+ var x : Int // expected-error {{invalid redeclaration of 'x'}}
37
+ // expected-note@-1 {{cannot automatically synthesize 'Encodable' because '<<error type>>' does not conform to 'Encodable'}}
38
+ // expected-note@-2 {{cannot automatically synthesize 'Encodable' because '<<error type>>' does not conform to 'Encodable'}}
39
+ }
40
+
41
+ struct SR_12248_2 : Decodable {
42
+ var x : Int // expected-note {{'x' previously declared here}}
43
+ var x : Int // expected-error {{invalid redeclaration of 'x'}}
44
+ }
45
+
46
+ struct SR_12248_3 : Encodable {
47
+ var x : Int // expected-note {{'x' previously declared here}}
48
+ var x : Int // expected-error {{invalid redeclaration of 'x'}}
49
+ }
You can’t perform that action at this time.
0 commit comments