提交 5099e06b 编写于 作者: C chandera

Make the logic for filtering instance members from outer types more precise. (changeset 1295646)

上级 4cd58fc4
......@@ -78,10 +78,10 @@ private bool ShouldIncludeSymbol(ISymbol symbol, AbstractSyntaxContext context,
if ((context.IsStatementContext || context.IsAnyExpressionContext) &&
!symbol.IsStatic &&
isMember &&
context.GetOuterTypes(cancellationToken).Contains(symbol.ContainingType))
context.GetOuterTypes(cancellationToken).SelectMany(o => o.GetBaseTypesAndThis()).Contains(symbol.ContainingType.OriginalDefinition))
{
var enclosingType = context.SemanticModel.GetEnclosingNamedType(context.LeftToken.SpanStart, cancellationToken);
return enclosingType != null && enclosingType.GetBaseTypes().Contains(symbol.ContainingType);
return enclosingType != null && enclosingType.GetBaseTypes().Select(b => b.OriginalDefinition).Contains(symbol.ContainingType.OriginalDefinition);
}
var namespaceSymbol = symbol as INamespaceSymbol;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册