dotnet / roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.

Home Page:https://josefpihrt.github.io/docs/roslynator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RCS1077 - Cannot convert from System.Func to System.Predicate

dylanvdmerwe opened this issue · comments

Product and Version Used:

  <ItemGroup>
    <PackageReference Include="roslynator.analyzers" Version="4.12.1">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="roslynator.formatting.analyzers" Version="4.12.1">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
  </ItemGroup>

Steps to Reproduce:

Actual Behavior:
Collection.FirstOrDefault(CustomerProductFieldValue.IsBrand);

Changes to:

Collection.Find(CustomerProductFieldValue.IsBrand);

However this does not compile.

Expected Behavior:
Collection.FirstOrDefault(CustomerProductFieldValue.IsBrand);

Changes to:

Collection.Find(x => CustomerProductFieldValue.IsBrand(x));

Or there should be a different kind of check here.