Beispiel #1
0
 public static SourceEnumConstantSymbol CreateImplicitValuedConstant(
     SourceMemberContainerTypeSymbol containingEnum,
     EnumMemberDeclarationSyntax syntax,
     SourceEnumConstantSymbol otherConstant,
     int otherConstantOffset,
     BindingDiagnosticBag diagnostics
     )
 {
     if ((object)otherConstant == null)
     {
         Debug.Assert(otherConstantOffset == 0);
         return(new ZeroValuedEnumConstantSymbol(containingEnum, syntax, diagnostics));
     }
     else
     {
         Debug.Assert(otherConstantOffset > 0);
         return(new ImplicitValuedEnumConstantSymbol(
                    containingEnum,
                    syntax,
                    otherConstant,
                    (uint)otherConstantOffset,
                    diagnostics
                    ));
     }
 }
Beispiel #2
0
            public ImplicitValuedEnumConstantSymbol(
                SourceMemberContainerTypeSymbol containingEnum,
                EnumMemberDeclarationSyntax syntax,
                SourceEnumConstantSymbol otherConstant,
                uint otherConstantOffset,
                BindingDiagnosticBag diagnostics
                ) : base(containingEnum, syntax, diagnostics)
            {
                Debug.Assert((object)otherConstant != null);
                Debug.Assert(otherConstantOffset > 0);

                _otherConstant       = otherConstant;
                _otherConstantOffset = otherConstantOffset;
            }
 public static SourceEnumConstantSymbol CreateImplicitValuedConstant(
     SourceMemberContainerTypeSymbol containingEnum,
     EnumMemberDeclarationSyntax syntax,
     SourceEnumConstantSymbol otherConstant,
     int otherConstantOffset,
     DiagnosticBag diagnostics)
 {
     if ((object)otherConstant == null)
     {
         Debug.Assert(otherConstantOffset == 0);
         return new ZeroValuedEnumConstantSymbol(containingEnum, syntax, diagnostics);
     }
     else
     {
         Debug.Assert(otherConstantOffset > 0);
         return new ImplicitValuedEnumConstantSymbol(containingEnum, syntax, otherConstant, (uint)otherConstantOffset, diagnostics);
     }
 }
            public ImplicitValuedEnumConstantSymbol(
                SourceMemberContainerTypeSymbol containingEnum,
                EnumMemberDeclarationSyntax syntax,
                SourceEnumConstantSymbol otherConstant,
                uint otherConstantOffset,
                DiagnosticBag diagnostics) :
                base(containingEnum, syntax, diagnostics)
            {
                Debug.Assert((object)otherConstant != null);
                Debug.Assert(otherConstantOffset > 0);

                this.otherConstant = otherConstant;
                this.otherConstantOffset = otherConstantOffset;
            }