1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
5 using System.Collections.Immutable;
7 using Microsoft.CodeAnalysis;
8 using Microsoft.CodeAnalysis.CSharp.Syntax;
10 namespace Microsoft.Interop
12 public sealed record MethodSignatureDiagnosticLocations(string MethodIdentifier, ImmutableArray<CodeAnalysis.Location> ManagedParameterLocations, CodeAnalysis.Location FallbackLocation)
14 public MethodSignatureDiagnosticLocations(MethodDeclarationSyntax syntax)
15 : this(syntax.Identifier.Text, syntax.ParameterList.Parameters.Select(p => p.Identifier.GetLocation()).ToImmutableArray(), syntax.Identifier.GetLocation())
19 public bool Equals(MethodSignatureDiagnosticLocations other)
21 return MethodIdentifier == other.MethodIdentifier
22 && ManagedParameterLocations.SequenceEqual(other.ManagedParameterLocations)
23 && FallbackLocation.Equals(other.FallbackLocation);
26 public override int GetHashCode() => throw new UnreachableException();