Closed controlflow closed 1 year ago
Probable same issue here: https://youtrack.jetbrains.com/issue/RIDER-75451
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LanguageExt.Core" Version="4.0.4" />
</ItemGroup>
</Project>
public static class Program
{
public static void Test()
{
var data = LanguageExt.Prelude.Atom<int>(default);
var i = 42;
data.Swap(_ => i); // <- wrong Closure can be eliminated inspection
}
}
Swap
is really overloaded to solve the issue of heap allocations:
The inspection is correct when applied to this Atom<T>
API.
Static local functions are not introducing closures see for details: https://youtrack.jetbrains.com/issue/RSRP-487543