diff --git a/Sources/Beet/Beets/Enums.swift b/Sources/Beet/Beets/Enums.swift index 3983ab4..76d31fb 100644 --- a/Sources/Beet/Beets/Enums.swift +++ b/Sources/Beet/Beets/Enums.swift @@ -245,6 +245,16 @@ public func mirrored(value: Any) -> (label: String, params: [String: Any]) { return ("\(value)", dictionary) } + if reflection.displayStyle == .struct { + var dictionary = [String: Any]() + for child in reflection.children { + if let label = child.label { + dictionary[label] = child.value + } + } + return ("\(value)", dictionary) + } + if reflection.displayStyle == .enum, let associated = reflection.children.first { let values = Mirror(reflecting: associated.value).children var valuesArray = [String: Any]() diff --git a/Sources/Beet/Struct.Fixable.swift b/Sources/Beet/Struct.Fixable.swift index 76e8247..f282d0a 100644 --- a/Sources/Beet/Struct.Fixable.swift +++ b/Sources/Beet/Struct.Fixable.swift @@ -78,18 +78,21 @@ public class FixableBeetStruct: FixableBeet { } public func toFixedFromValue(val: Any) -> FixedSizeBeet { - let value = val as! Args - let argsKeys = value.keys - var fixedFields: [FixedBeetField] = [] + let mirror = mirrored(value: val) - for i in 0..