A macro that sets the cases of an enum as properties of a struct?
Swift Forums
A macro that sets the cases of an enum as properties of a struct?
I am struggling to write a macro that does the following: enum E: CaseIterable { case a case b } @CasesAsProperties(from: E.Type, typeDeclaration: "String") struct S { } should result in the following declaration of S: struct S { let a: String let b: String } Does there exist a macro like that (could not find one), or else how would such a macro look like?
I am struggling to write a macro that does the following: enum E: CaseIterable { case a case b } @CasesAsProperties(from: E.Type, typeDeclaration: "String") struct S { } should…
0 comments
No comments yet.