private void ComputeHashCodePartsIgnoringLocation(Action <int> addPart)
 {
     addPart(SymbolOpt.GetHashCodeOrDefault());
     addPart(HashUtilities.Combine(Indices));
     addPart(InstanceReferenceOperationSyntaxOpt.GetHashCodeOrDefault());
     addPart(CaptureIdOpt.GetHashCodeOrDefault());
     addPart(Type.GetHashCode());
     addPart(ParentOpt.GetHashCodeOrDefault());
     addPart(IsThisOrMeInstance.GetHashCode());
 }
 private void ComputeHashCodePartsIgnoringLocation(ArrayBuilder <int> builder)
 {
     builder.Add(SymbolOpt.GetHashCodeOrDefault());
     builder.Add(HashUtilities.Combine(Indices));
     builder.Add(InstanceReferenceOperationSyntaxOpt.GetHashCodeOrDefault());
     builder.Add(CaptureIdOpt.GetHashCodeOrDefault());
     builder.Add(Type.GetHashCode());
     builder.Add(ParentOpt.GetHashCodeOrDefault());
     builder.Add(IsThisOrMeInstance.GetHashCode());
 }
        private int ComputeIgnoringLocationHashCode()
        {
            var hashCode = HashUtilities.Combine(SymbolOpt?.GetHashCode() ?? 0,
                                                 HashUtilities.Combine(InstanceReferenceOperationSyntaxOpt?.GetHashCode() ?? 0,
                                                                       HashUtilities.Combine(Type.GetHashCode(),
                                                                                             HashUtilities.Combine(ParentOpt?.GetHashCode() ?? 0,
                                                                                                                   HashUtilities.Combine(IsThisOrMeInstance.GetHashCode(), Indices.Length.GetHashCode())))));

            foreach (AbstractIndex index in Indices)
            {
                hashCode = HashUtilities.Combine(index.GetHashCode(), hashCode);
            }

            return(hashCode);
        }