Skip to content

Commit

Permalink
explicit property and event implementations are not being recognized/…
Browse files Browse the repository at this point in the history
…matched
  • Loading branch information
beakona committed May 16, 2022
1 parent 13ef06e commit e30108e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BeaKona.AutoInterfaceGenerator/ITypeSymbolExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,16 @@ public static bool IsMemberImplemented(this ITypeSymbol @this, ISymbol member)
{
ISymbol? implementation = @this.FindImplementationForInterfaceMember(member);

if (implementation is null || !implementation.ContainingType.Equals(@this, SymbolEqualityComparer.Default))
if (implementation is null || implementation.IsStatic || !implementation.ContainingType.Equals(@this, SymbolEqualityComparer.Default))
{
return false;
}

return implementation switch
{
IMethodSymbol memberImplementation => memberImplementation.MethodKind == MethodKind.ExplicitInterfaceImplementation,
IMethodSymbol methodImplementation => methodImplementation.MethodKind == MethodKind.ExplicitInterfaceImplementation,
IPropertySymbol propertyImplementation => propertyImplementation.ExplicitInterfaceImplementations.Any(),
IEventSymbol eventImplementation => eventImplementation.ExplicitInterfaceImplementations.Any(),
_ => false,
};
}
Expand Down

0 comments on commit e30108e

Please sign in to comment.