Browse Source

[CodeIssues] RedundantTypeCastIssue: use .Equals() for comparing types

newNRvisualizers
Mansheng Yang 14 years ago
parent
commit
80d02a5b76
  1. 2
      ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantTypeCastIssue.cs

2
ICSharpCode.NRefactory.CSharp/Refactoring/CodeIssues/RedundantTypeCastIssue.cs

@ -97,7 +97,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
var expectedType = GetExpectedType (typeCastNode); var expectedType = GetExpectedType (typeCastNode);
var exprType = ctx.Resolve (expr).Type; var exprType = ctx.Resolve (expr).Type;
if (exprType.GetAllBaseTypes ().Any (t => t == expectedType)) if (exprType.GetAllBaseTypes ().Any (t => t.Equals(expectedType)))
AddIssue (typeCastNode, expr, castStart, castEnd); AddIssue (typeCastNode, expr, castStart, castEnd);
} }
} }

Loading…
Cancel
Save