Skip to content

Commit

Permalink
Suppress wrong inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmarbach committed Jul 20, 2019
1 parent 1ae0e06 commit b072667
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PublicApiGenerator/ApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static void PopulateGenericParameters(IGenericParameterProvider publicType, Code
typeParameter.Constraints.Add(" class");
foreach (var constraint in parameter.Constraints.Where(t => t.FullName != "System.ValueType"))
{
// for generic constraints like IEnumerable<T> call to GetElementType() returns TypeReference with Name = !0
// for generic constraints like IEnumerable<T> call to GetElementType() returns TypeReference with Name = !0
typeParameter.Constraints.Add(CreateCodeTypeReference(constraint/*.GetElementType()*/));
}
parameters.Add(typeParameter);
Expand Down Expand Up @@ -842,7 +842,8 @@ static string GetTypeName(TypeReference type)

static CodeTypeReference[] CreateGenericArguments(TypeReference type)
{
var genericArgs = type is IGenericInstance instance ? instance.GenericArguments : (type.HasGenericParameters ? type.GenericParameters.Cast<TypeReference>() : null);
// ReSharper disable once RedundantEnumerableCastCall
var genericArgs = type is IGenericInstance instance ? instance.GenericArguments : type.HasGenericParameters ? type.GenericParameters.Cast<TypeReference>() : null;
if (genericArgs == null) return null;

var genericArguments = new List<CodeTypeReference>();
Expand Down

0 comments on commit b072667

Please sign in to comment.