Update analyzer versions (dotnet/corefx#42249)
authorStephen Toub <stoub@microsoft.com>
Thu, 31 Oct 2019 04:27:10 +0000 (00:27 -0400)
committerSantiago Fernandez Madero <safern@microsoft.com>
Thu, 31 Oct 2019 04:27:10 +0000 (22:27 -0600)
* Update analyzer packages to latest NuGet versions

* Fix new warnings

Commit migrated from https://github.com/dotnet/corefx/commit/51686cbf80a980f187a144fa02cf3730ef16ba00

eng/analyzers.props
src/libraries/Common/src/System/Reflection/Emit/IgnoreAccessChecksToAttributeBuilder.cs
src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/PartBuilderOfT.cs
src/libraries/System.Composition.Convention/src/System/Composition/Convention/PartConventionBuilderOfT.cs

index f49d7a9..5a52208 100644 (file)
@@ -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>
index 90e4701..1e90f60 100644 (file)
@@ -76,7 +76,7 @@ namespace System.Reflection.Emit
             // 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
index b7a6aa5..0f349ac 100644 (file)
@@ -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;
 
@@ -116,7 +115,7 @@ namespace System.ComponentModel.Composition.Registration
                     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)
index 3706d77..6e4e06a 100644 (file)
@@ -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
 {
@@ -182,7 +181,7 @@ namespace System.Composition.Convention
                     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)