Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug where ToHashSet() is implemented in .Net 4.7.1+ System.Linq, causing failure to compile #739

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MoreLinq/Extensions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6377,6 +6377,7 @@ public static Dictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerab

}

#if !NET472
/// <summary><c>ToHashSet</c> extension.</summary>

[GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")]
Expand Down Expand Up @@ -6414,6 +6415,7 @@ public static HashSet<TSource> ToHashSet<TSource>(this IEnumerable<TSource> sour
=> MoreEnumerable.ToHashSet(source, comparer);

}
#endif

/// <summary><c>ToLookup</c> extension.</summary>

Expand Down
8 changes: 4 additions & 4 deletions MoreLinq/MoreLinq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>3.3.1</VersionPrefix>
<Authors>MoreLINQ Developers.</Authors>
<TargetFrameworks>net451;netstandard1.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net451;net472;netstandard1.0;netstandard2.0</TargetFrameworks>
<LangVersion>8</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>portable</DebugType>
Expand All @@ -146,7 +146,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down Expand Up @@ -184,7 +184,7 @@
<Reference Include="System" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net451' ">
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net451' Or '$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);MORELINQ</DefineConstants>
</PropertyGroup>

Expand All @@ -197,7 +197,7 @@
<Compile Remove="Extensions.ToDataTable.g.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.0' Or '$(TargetFramework)' == 'net451'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.0' Or '$(TargetFramework)' == 'net451' Or '$(TargetFramework)' == 'net472'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions MoreLinq/ToHashSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// limitations under the License.
#endregion

#if !NET472
namespace MoreLinq
{
using System;
Expand Down Expand Up @@ -60,3 +61,4 @@ public static HashSet<TSource> ToHashSet<TSource>(this IEnumerable<TSource> sour
}
}
}
#endif