Open AlekseyTs opened 2 years ago
CC @sharwell
@AlekseyTs I debugged into this on the IDE side. We make a call here to determine what interface members a particular member is an implementation of:
public static ImmutableArray<ISymbol> ExplicitOrImplicitInterfaceImplementations(this ISymbol symbol)
{
if (symbol.Kind is not SymbolKind.Method and not SymbolKind.Property and not SymbolKind.Event)
return [];
var containingType = symbol.ContainingType;
var query = from iface in containingType.AllInterfaces
from interfaceMember in iface.GetMembers()
let impl = containingType.FindImplementationForInterfaceMember(interfaceMember)
where symbol.Equals(impl)
select interfaceMember;
return query.ToImmutableArray();
}
However, in the bowels of FindImplementationForInterfaceMember it eventually gets to: TypeSymbol.FindMostSpecificImplementation which does this:
case 1:
{
Symbol result = implementingMember.Single();
if (result.IsAbstract)
{
return null;
}
As this member is abstract, it's not considered an implementation of the interface member.
Is this the expected behavior of this API? If so, do you have a recommendation on how to get the originating interface member that an explicit abstract member is an implementation of?
Try using "Go To Definition" on abstract explicit implementations.
Observed: Doesn't work.
Expected: Should go to the corresponding definition in I1.