Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public override void VisitUnionCaseDeclaration(IUnionCaseDeclaration decl)
 {
     Builder.StartPart(new UnionCasePart(decl, Builder, decl.Parent is ISingleCaseUnionDeclaration));
     ProcessTypeMembers(decl.MemberDeclarations);
     Builder.EndPart();
 }