Skip to content

Commit

Permalink
Update analyzer versions (dotnet/corefx#42249)
Browse files Browse the repository at this point in the history
* Update analyzer packages to latest NuGet versions

* Fix new warnings


Commit migrated from dotnet/corefx@51686cb
  • Loading branch information
stephentoub authored and safern committed Oct 31, 2019
1 parent 2e2459b commit fe91ca7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions eng/analyzers.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.3.0-beta2-final" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.4.0-beta2-final" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.66" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static ConstructorInfo AddToModule(ModuleBuilder mb)
// Find the ctor that takes only AttributeTargets
ConstructorInfo attributeUsageConstructorInfo =
attributeUsageTypeInfo.DeclaredConstructors
.Single(c => c.GetParameters().Count() == 1 &&
.Single(c => c.GetParameters().Length == 1 &&
c.GetParameters()[0].ParameterType == typeof(AttributeTargets));

// Find the property to set AllowMultiple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;

Expand Down Expand Up @@ -116,7 +115,7 @@ private void ParseSelectConstructor(Expression<Func<ParameterImportBuilder, T>>
if (argument.NodeType == ExpressionType.Call)
{
var methodCallExpression = (MethodCallExpression)argument;
if (methodCallExpression.Arguments.Count() == 1)
if (methodCallExpression.Arguments.Count == 1)
{
Expression parameter = methodCallExpression.Arguments[0];
if (parameter.NodeType == ExpressionType.Lambda)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Linq.Expressions;
using System.Reflection;

namespace System.Composition.Convention
{
Expand Down Expand Up @@ -182,7 +181,7 @@ private void ParseSelectConstructor(Expression<Func<ParameterImportConventionBui
if (argument.NodeType == ExpressionType.Call)
{
var methodCallExpression = (MethodCallExpression)argument;
if (methodCallExpression.Arguments.Count() == 1)
if (methodCallExpression.Arguments.Count == 1)
{
Expression parameter = methodCallExpression.Arguments[0];
if (parameter.NodeType == ExpressionType.Lambda)
Expand Down

0 comments on commit fe91ca7

Please sign in to comment.