File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
test/decl/protocol/special/coding Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ class DecodableSuper : Decodable {
63
63
64
64
// expected-note@+1 {{did you mean to override 'init(from:)'?}}{{+1:1-1=\noverride init(from decoder: Decoder) throws {\n <#code#>\n\}}}
65
65
class DecodableSubWithoutInitialValue : DecodableSuper { // expected-error {{class 'DecodableSubWithoutInitialValue' has no initializers}}
66
+ // expected-warning{{'required' initializer 'init(from:)' must be provided by subclass of 'DecodableSuper'}}
66
67
var value2 : Int // expected-note {{stored property 'value2' without initial value prevents synthesized initializers}}
67
68
}
68
69
@@ -78,6 +79,7 @@ class CodableSuper : Codable {
78
79
79
80
// expected-note@+1 {{did you mean to override 'init(from:)' and 'encode(to:)'?}}{{+1:1-1=\noverride init(from decoder: Decoder) throws {\n <#code#>\n\}\n\noverride func encode(to encoder: Encoder) throws {\n <#code#>\n\}}}
80
81
class CodableSubWithoutInitialValue : CodableSuper { // expected-error {{class 'CodableSubWithoutInitialValue' has no initializers}}
82
+ // expected-warning{{'required' initializer 'init(from:)' must be provided by subclass of 'CodableSuper'; this is an error in Swift 6}}
81
83
var value2 : Int // expected-note {{stored property 'value2' without initial value prevents synthesized initializers}}
82
84
}
83
85
@@ -86,6 +88,7 @@ class CodableSubWithoutInitialValue : CodableSuper { // expected-error {{class '
86
88
//
87
89
// expected-note@+1 {{did you mean to override 'init(from:)'?}}{{+1:1-1=\noverride init(from decoder: Decoder) throws {\n <#code#>\n\}}}
88
90
class EncodableSubWithoutInitialValue : CodableSuper { // expected-error {{class 'EncodableSubWithoutInitialValue' has no initializers}}
91
+ // expected-warning{{'required' initializer 'init(from:)' must be provided by subclass of 'CodableSuper'; this is an error in Swift 6}}
89
92
var value2 : Int // expected-note {{stored property 'value2' without initial value prevents synthesized initializers}}
90
93
91
94
override func encode( to: Encoder ) throws { }
You can’t perform that action at this time.
0 commit comments