public static MemberDecoration GetDecoration(IUnionCaseDeclaration caseDeclaration) { if (caseDeclaration.FieldsEnumerable.IsEmpty()) { return(MemberDecoration.FromModifiers(Modifiers.INTERNAL)); } return(caseDeclaration.GetContainingTypeDeclaration() is IUnionDeclaration unionDeclaration ? GetDecoration(unionDeclaration.AccessModifiers, TreeNodeEnumerable <IFSharpAttribute> .Empty) : MemberDecoration.DefaultValue); }
public static MemberDecoration GetDecoration(IUnionCaseDeclaration caseDeclaration) { if (caseDeclaration.FieldsEnumerable.IsEmpty()) { return(MemberDecoration.FromModifiers(Modifiers.INTERNAL)); } return(UnionRepresentationNavigator.GetByUnionCase(caseDeclaration) is var repr && FSharpTypeDeclarationNavigator.GetByTypeRepresentation(repr) is { } decl ? GetDecoration(decl.AccessModifier, TreeNodeCollection <IAttribute> .Empty) : MemberDecoration.DefaultValue); }
public override void VisitUnionCaseDeclaration(IUnionCaseDeclaration decl) { Builder.StartPart(new UnionCasePart(decl, Builder, decl.Parent is ISingleCaseUnionDeclaration)); ProcessTypeMembers(decl.MemberDeclarations); Builder.EndPart(); }