Skip to content

Commit 76bcf69

Browse files
authored
Merge pull request #798 from polyadic/dotnet-9
2 parents 1f271a6 + ba75ecb commit 76bcf69

27 files changed

+152
-60
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88

99
env:
1010
DOTNET_NOLOGO: 1
11+
# This is for some reason set to 'all' on CI which means
12+
# we get warnings for transitive dependencies (e.g. from Messerli.CodeStyle -> StyleCop)
13+
NuGetAuditMode: direct
1114

1215
jobs:
1316
build:
@@ -24,13 +27,9 @@ jobs:
2427
- uses: actions/setup-dotnet@v4
2528
name: Install Current .NET SDK
2629
- uses: actions/setup-dotnet@v4
27-
name: 'Install .NET SDK 3.1'
30+
name: 'Install .NET SDK 8.0'
2831
with:
29-
dotnet-version: '3.1.x'
30-
- uses: actions/setup-dotnet@v4
31-
name: 'Install .NET SDK 5.0'
32-
with:
33-
dotnet-version: '5.0.x'
32+
dotnet-version: '8.0.x'
3433
- uses: actions/setup-dotnet@v4
3534
name: 'Install .NET SDK 7.0'
3635
with:

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
2424
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2525
</PropertyGroup>
26-
<ItemGroup Label="Deterministic Builds and Source Link">
27-
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/>
28-
</ItemGroup>
2926
<PropertyGroup>
3027
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
3128
</PropertyGroup>

Directory.Packages.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
<PackageVersion Include="System.Linq.Async" Version="[5.0.0, 7)" />
1313
</ItemGroup>
1414
<ItemGroup Label="Build Dependencies">
15-
<PackageVersion Include="PolySharp" Version="1.14.0" />
15+
<PackageVersion Include="PolySharp" Version="1.15.0" />
1616
<PackageVersion Include="Messerli.CodeStyle" Version="2.3.0" />
1717
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3" />
18-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
1918
</ItemGroup>
2019
<ItemGroup Label="Test Dependencies">
2120
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />

FrameworkFeatureConstants.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
1919
<DefineConstants>$(DefineConstants);RANDOM_SHUFFLE;UTF8_SPAN_PARSABLE</DefineConstants>
2020
</PropertyGroup>
21+
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
22+
<DefineConstants>$(DefineConstants);REFLECTION_ASSEMBLY_NAME_INFO;REFLECTION_TYPE_NAME</DefineConstants>
23+
</PropertyGroup>
2124
</Project>

Funcky.Analyzers/Funcky.Analyzers.Test/Funcky.Analyzers.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55

66
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
77
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

Funcky.Async.Test/Funcky.Async.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0;net7.0</TargetFrameworks>
3+
<TargetFrameworks>net9.0;net8.0;net7.0</TargetFrameworks>
44
<LangVersion>preview</LangVersion>
55
<Nullable>enable</Nullable>
66
<IsPackable>false</IsPackable>

Funcky.Async/Extensions/AsyncEnumerableExtensions/Merge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static async IAsyncEnumerable<TSource> Merge<TSource>(this IEnumerable<IA
6161

6262
try
6363
{
64-
await foreach (var element in MergeEnumerators(enumerators.RemoveRange(await enumerators.ToAsyncEnumerable().WhereAwait(async f => await HasMoreElements(f).ConfigureAwait(false)).ToListAsync().ConfigureAwait(false)), GetMergeComparer(comparer)))
64+
await foreach (var element in MergeEnumerators(enumerators.RemoveRange(await enumerators.ToAsyncEnumerable().WhereAwait(async f => await HasMoreElements(f).ConfigureAwait(false)).ToListAsync().ConfigureAwait(false)), GetMergeComparer(comparer)).ConfigureAwait(false))
6565
{
6666
yield return element;
6767
}

Funcky.Async/Extensions/AsyncEnumerableExtensions/PowerSet.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,22 @@ public static IAsyncEnumerable<IEnumerable<TSource>> PowerSet<TSource>(this IAsy
1818

1919
private static async IAsyncEnumerable<IEnumerable<TSource>> PowerSetInternal<TSource>(this IAsyncEnumerable<TSource> source, [EnumeratorCancellation] CancellationToken cancellationToken = default)
2020
{
21-
var asyncEnumerator = source.GetAsyncEnumerator(cancellationToken);
22-
await using var sourceEnumerator = asyncEnumerator.ConfigureAwait(false);
21+
#pragma warning disable CA2007 // Configured via IAsyncEnumerable<T> extension
22+
await using var asyncEnumerator = source.ConfigureAwait(false).WithCancellation(cancellationToken).GetAsyncEnumerator();
23+
#pragma warning restore CA2007
2324

24-
await foreach (var set in PowerSetEnumerator(asyncEnumerator).WithCancellation(cancellationToken))
25+
await foreach (var set in PowerSetEnumerator(asyncEnumerator).WithCancellation(cancellationToken).ConfigureAwait(false))
2526
{
2627
yield return set;
2728
}
2829
}
2930

30-
private static async IAsyncEnumerable<ImmutableStack<TSource>> PowerSetEnumerator<TSource>(this IAsyncEnumerator<TSource> source)
31+
private static async IAsyncEnumerable<ImmutableStack<TSource>> PowerSetEnumerator<TSource>(this ConfiguredCancelableAsyncEnumerable<TSource>.Enumerator source)
3132
{
32-
if (await source.MoveNextAsync().ConfigureAwait(false))
33+
if (await source.MoveNextAsync())
3334
{
3435
var temp = source.Current;
35-
await foreach (var set in source.PowerSetEnumerator())
36+
await foreach (var set in source.PowerSetEnumerator().ConfigureAwait(false))
3637
{
3738
yield return set;
3839
yield return set.Push(temp);

Funcky.Async/Extensions/AsyncEnumerableExtensions/WithPrevious.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
using System.Runtime.CompilerServices;
2+
13
namespace Funcky.Extensions;
24

35
public static partial class AsyncEnumerableExtensions
46
{
57
/// <summary>Returns a sequence mapping each element together with its predecessor.</summary>
68
/// <exception cref="ArgumentNullException">Thrown when any value in <paramref name="source"/> is <see langword="null"/>.</exception>
79
[Pure]
8-
public static async IAsyncEnumerable<ValueWithPrevious<TSource>> WithPrevious<TSource>(this IAsyncEnumerable<TSource> source)
10+
public static IAsyncEnumerable<ValueWithPrevious<TSource>> WithPrevious<TSource>(this IAsyncEnumerable<TSource> source)
11+
where TSource : notnull
12+
=> source.WithPreviousInternal();
13+
14+
private static async IAsyncEnumerable<ValueWithPrevious<TSource>> WithPreviousInternal<TSource>(this IAsyncEnumerable<TSource> source, [EnumeratorCancellation] CancellationToken cancellationToken = default)
915
where TSource : notnull
1016
{
1117
var previous = Option<TSource>.None;
1218

13-
await foreach (var value in source)
19+
await foreach (var value in source.ConfigureAwait(false).WithCancellation(cancellationToken))
1420
{
1521
yield return new ValueWithPrevious<TSource>(value, previous);
1622
previous = value;

Funcky.Async/Funcky.Async.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0;net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
3+
<TargetFrameworks>net9.0;net8.0;net5.0;netstandard2.1;netstandard2.0</TargetFrameworks>
44
<LangVersion>preview</LangVersion>
55
<Nullable>enable</Nullable>
66
<Description>Extends Funcky with support for IAsyncEnumerable and Tasks.</Description>

0 commit comments

Comments
 (0)