Files
feldspar e0efea91d0 Nested types fix
commit_hash:0e61cb86c4ecce349d6b76477d5f025a5896aa81
2026-02-26 13:21:52 +03:00

49 lines
1.2 KiB
Swift

// Generated code. Do not modify.
import Foundation
import Serialization
import VGSL
@frozen
public enum DivDrawable: Sendable {
case divShapeDrawable(DivShapeDrawable)
public var value: Serializable {
switch self {
case let .divShapeDrawable(value):
return value
}
}
}
extension DivDrawable {
public init(dictionary: [String: Any], context: ParsingContext) throws {
let dictionary = context.templateResolver?(dictionary) ?? dictionary
let blockType = try dictionary.getField("type") as String
switch blockType {
case DivShapeDrawable.type:
self = .divShapeDrawable(try DivShapeDrawable(dictionary: dictionary, context: context))
default:
throw DeserializationError.requiredFieldIsMissing(field: "type")
}
}
}
#if DEBUG
extension DivDrawable: Equatable {
public static func ==(lhs: DivDrawable, rhs: DivDrawable) -> Bool {
switch (lhs, rhs) {
case let (.divShapeDrawable(l), .divShapeDrawable(r)):
return l == r
}
}
}
#endif
extension DivDrawable: Serializable {
@_optimize(size)
public func toDictionary() -> [String: ValidSerializationValue] {
return value.toDictionary()
}
}