private UncommonFields CreateUncommonFields() { var retVal = new UncommonFields(); if (!_packedFlags.IsObsoleteAttributePopulated) { retVal._lazyObsoleteAttributeData = ObsoleteAttributeData.Uninitialized; } if (!_packedFlags.IsUseSiteDiagnosticPopulated) { retVal._lazyUseSiteDiagnostic = CSDiagnosticInfo.EmptyErrorInfo; // Indicates unknown state. } if (_packedFlags.IsCustomAttributesPopulated) { retVal._lazyCustomAttributes = ImmutableArray <CSharpAttributeData> .Empty; } if (_packedFlags.IsConditionalPopulated) { retVal._lazyConditionalAttributeSymbols = ImmutableArray <string> .Empty; } if (_packedFlags.IsOverriddenOrHiddenMembersPopulated) { retVal._lazyOverriddenOrHiddenMembersResult = OverriddenOrHiddenMembersResult.Empty; } return(retVal); }
private UncommonFields CreateUncommonFields() { var retVal = new UncommonFields(); if (!_packedFlags.IsObsoleteAttributePopulated) { retVal._lazyObsoleteAttributeData = ObsoleteAttributeData.Uninitialized; } // // Do not set _lazyUseSiteDiagnostic !!!! // // "null" Indicates "no errors" or "unknown state", // and we know which one of the states we have from IsUseSiteDiagnosticPopulated // // Setting _lazyUseSiteDiagnostic to a sentinel value here would introduce // a number of extra states for various permutations of IsUseSiteDiagnosticPopulated, UncommonFields and _lazyUseSiteDiagnostic // Some of them, in tight races, may lead to returning the sentinel as the diagnostics. // if (_packedFlags.IsCustomAttributesPopulated) { retVal._lazyCustomAttributes = ImmutableArray <CSharpAttributeData> .Empty; } if (_packedFlags.IsConditionalPopulated) { retVal._lazyConditionalAttributeSymbols = ImmutableArray <string> .Empty; } if (_packedFlags.IsOverriddenOrHiddenMembersPopulated) { retVal._lazyOverriddenOrHiddenMembersResult = OverriddenOrHiddenMembersResult.Empty; } return(retVal); }
private UncommonFields CreateUncommonFields() { var retVal = new UncommonFields(); if (!_packedFlags.IsObsoleteAttributePopulated) { retVal._lazyObsoleteAttributeData = ObsoleteAttributeData.Uninitialized; } if (!_packedFlags.IsUseSiteDiagnosticPopulated) { retVal._lazyUseSiteDiagnostic = CSDiagnosticInfo.EmptyErrorInfo; // Indicates unknown state. } if (_packedFlags.IsCustomAttributesPopulated) { retVal._lazyCustomAttributes = ImmutableArray<CSharpAttributeData>.Empty; } if (_packedFlags.IsConditionalPopulated) { retVal._lazyConditionalAttributeSymbols = ImmutableArray<string>.Empty; } if (_packedFlags.IsOverriddenOrHiddenMembersPopulated) { retVal._lazyOverriddenOrHiddenMembersResult = OverriddenOrHiddenMembersResult.Empty; } return retVal; }