Files
swift-mirror/test/refactoring/AddCodableImplementation/Outputs/access/public.swift.expected
Rintaro Ishizaki 39606e6269 [refactoring] Rework "add codable implementation" refactoring
* Support extensions including conditional conformance
* Correct access modifiers
* More correct lookup for the synthesized declarations
* Avoid printing decls in nested types (rdar://98025945)
2024-03-13 13:34:32 +09:00

33 lines
681 B
Plaintext

private struct PrivateS: Codable {
let value: Int
}
public struct PublicS: Codable {
let value: Int
private enum CodingKeys: CodingKey {
case value
}
public init(from decoder: any Decoder) throws {
let container: KeyedDecodingContainer<PublicS.CodingKeys> = try decoder.container(keyedBy: PublicS.CodingKeys.self)
self.value = try container.decode(Int.self, forKey: PublicS.CodingKeys.value)
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: PublicS.CodingKeys.self)
try container.encode(self.value, forKey: PublicS.CodingKeys.value)
}
}
open class OpenC: Codable {
let value: Int
}