Closed donnywdavis closed 7 months ago
Macros cannot see the parent, so we can't extrapolate the public
access on the extension, but it does look like we can always apply public
to these APIs, even if the container is not. Should be fixed when #149 is merged!
I figured that it might be a limitation of macros. Thank you for still finding a solution. Really enjoying the possibilities that this package has opened up for us. 😃
Describe the bug I have an enum that is defined in an extension that is
public
. The enum inherits thepublic
access modifier from the extension, however, theAllCasePaths
struct andallCasePaths
properties do not. This causes the build to fail since these two pieces do not have the same access modifier as the enum that is configured withCasePathable
.If I add the
public
access modifier directly to the enum then everything works as expected. Even if I move thepublic
keyword, we useSwiftFormat
, that has a rule that moves that modifier to the extension. We would have to disable that rule to make it work. Would it be possible that this could work in both contexts, or is this a limitation of macros?Environment