提交 b30d263c 编写于 作者: M manishv

Fix for bug 902508: Redundant casts not shown on some conditional code

Correct a silly typo in IsRequiredCastForReferenceEqualityComparison: no casts parented by an equality comparison to null should be deemed neccessary. (changeset 1215599)
上级 21b35dcf
......@@ -85,7 +85,7 @@ private static bool IsRequiredCastForReferenceEqualityComparison(ITypeSymbol out
// Explicit cast not required if we are comparing with type parameter with a class constraint.
var otherType = semanticModel.GetTypeInfo(other).Type;
if (otherType == null || otherType.TypeKind != TypeKind.TypeParameter)
if (otherType != null && otherType.TypeKind != TypeKind.TypeParameter)
{
return !other.WalkDownParentheses().IsKind(SyntaxKind.CastExpression);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册