diff --git a/Sources/DiscriminatedUnionClient/main.swift b/Sources/DiscriminatedUnionClient/main.swift index 46dcc2f..0b3ccba 100644 --- a/Sources/DiscriminatedUnionClient/main.swift +++ b/Sources/DiscriminatedUnionClient/main.swift @@ -8,7 +8,6 @@ enum Pet { case parrot(loud: Bool) case snake case turtle(snapper: Bool) - } Swift.print("usiyan::: Pet.Discriminant.dog == Pet.dog.discriminant: \(String(describing: Pet.Discriminant.dog == Pet.dog.discriminant))") diff --git a/Sources/DiscriminatedUnionMacros/DiscriminatedUnionMacro.swift b/Sources/DiscriminatedUnionMacros/DiscriminatedUnionMacro.swift index fef6713..7ab6f93 100644 --- a/Sources/DiscriminatedUnionMacros/DiscriminatedUnionMacro.swift +++ b/Sources/DiscriminatedUnionMacros/DiscriminatedUnionMacro.swift @@ -65,7 +65,7 @@ extension DiscriminatedUnionMacro: MemberMacro { } func declareDiscriminantType() throws -> EnumDeclSyntax { - try EnumDeclSyntax("enum Discriminant: DiscriminantType") { + try EnumDeclSyntax("public enum Discriminant: DiscriminantType") { for singleCase in childCases { EnumCaseDeclSyntax( leadingTrivia: .carriageReturn) { @@ -95,7 +95,7 @@ extension DiscriminatedUnionMacro: MemberMacro { return DeclSyntax(stringLiteral:""" - var hasAssociatedType: Bool { + public var hasAssociatedType: Bool { \(theSwitch) } """ @@ -119,7 +119,7 @@ extension DiscriminatedUnionMacro: MemberMacro { return """ - var discriminant: Discriminant { + public var discriminant: Discriminant { \(switchWrittenOut) } """