the.bay.news

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

Sign in to join the discussion — your thebay.events account works here.

No comments yet.