Skip to content

Commit

Permalink
Enable nullable reference types.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartdesmet committed May 25, 2019
1 parent 447c3fb commit f329683
Show file tree
Hide file tree
Showing 67 changed files with 612 additions and 574 deletions.
2 changes: 1 addition & 1 deletion Ix.NET/Source/AsyncQueryableGenerator.t4
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ foreach (var m in asyncEnumerableType.GetMethods()
}
}

var pars = string.Join(", ", m.GetParameters().Select((p, i) => (i == parCount - 1 && isParams ? "params " : "") + toQuoted(p.ParameterType, i) + " " + p.Name + (i == parCount - 1 && lastParameterDefault ? " = default" : "")));
var pars = string.Join(", ", m.GetParameters().Select((p, i) => (i == parCount - 1 && isParams ? "params " : "") + toQuoted(p.ParameterType, i) + (nullableParameterNames.Contains(p.Name) ? "?" : "") + " " + p.Name + (i == parCount - 1 && lastParameterDefault ? " = default" : "")));
var quotedPars = string.Join(", ", m.GetParameters().Select((p, i) => "default(" + toQuoted(p.ParameterType, i) + ")"));

if (m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AssemblyTitle>Interactive Extensions - Async Providers Library</AssemblyTitle>
<TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
<PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
<NullableContextOptions>enable</NullableContextOptions>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,4 +22,8 @@
<Compile Update="System\Linq\AsyncQueryableEx.Generated.cs" DesignTime="True" AutoGen="True" DependentUpon="AsyncQueryableEx.Generated.tt" />
</ItemGroup>

<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private static MethodInfo Distinct__TSource_TKey__3__0(Type TSource, Type TKey)
(s_Distinct__TSource_TKey__3__0 ??
(s_Distinct__TSource_TKey__3__0 = new Func<IAsyncQueryable<object>, Expression<Func<object, CancellationToken, ValueTask<object>>>, IEqualityComparer<object>, IAsyncQueryable<object>>(Distinct<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey>? comparer)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -204,7 +204,7 @@ private static MethodInfo Distinct__TSource_TKey__3__1(Type TSource, Type TKey)
(s_Distinct__TSource_TKey__3__1 ??
(s_Distinct__TSource_TKey__3__1 = new Func<IAsyncQueryable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IAsyncQueryable<object>>(Distinct<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -220,7 +220,7 @@ private static MethodInfo Distinct__TSource_TKey__3__2(Type TSource, Type TKey)
(s_Distinct__TSource_TKey__3__2 ??
(s_Distinct__TSource_TKey__3__2 = new Func<IAsyncQueryable<object>, Expression<Func<object, ValueTask<object>>>, IEqualityComparer<object>, IAsyncQueryable<object>>(Distinct<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
public static IAsyncQueryable<TSource> Distinct<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey>? comparer)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down Expand Up @@ -250,7 +250,7 @@ private static MethodInfo DistinctUntilChanged__TSource__2__0(Type TSource) =>
(s_DistinctUntilChanged__TSource__2__0 ??
(s_DistinctUntilChanged__TSource__2__0 = new Func<IAsyncQueryable<object>, IEqualityComparer<object>, IAsyncQueryable<object>>(DistinctUntilChanged<object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);

public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource>(this IAsyncQueryable<TSource> source, IEqualityComparer<TSource> comparer)
public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource>(this IAsyncQueryable<TSource> source, IEqualityComparer<TSource>? comparer)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down Expand Up @@ -312,7 +312,7 @@ private static MethodInfo DistinctUntilChanged__TSource_TKey__3__0(Type TSource,
(s_DistinctUntilChanged__TSource_TKey__3__0 ??
(s_DistinctUntilChanged__TSource_TKey__3__0 = new Func<IAsyncQueryable<object>, Expression<Func<object, CancellationToken, ValueTask<object>>>, IEqualityComparer<object>, IAsyncQueryable<object>>(DistinctUntilChanged<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey>? comparer)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -328,7 +328,7 @@ private static MethodInfo DistinctUntilChanged__TSource_TKey__3__1(Type TSource,
(s_DistinctUntilChanged__TSource_TKey__3__1 ??
(s_DistinctUntilChanged__TSource_TKey__3__1 = new Func<IAsyncQueryable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IAsyncQueryable<object>>(DistinctUntilChanged<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -344,7 +344,7 @@ private static MethodInfo DistinctUntilChanged__TSource_TKey__3__2(Type TSource,
(s_DistinctUntilChanged__TSource_TKey__3__2 ??
(s_DistinctUntilChanged__TSource_TKey__3__2 = new Func<IAsyncQueryable<object>, Expression<Func<object, ValueTask<object>>>, IEqualityComparer<object>, IAsyncQueryable<object>>(DistinctUntilChanged<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
public static IAsyncQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey>? comparer)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down Expand Up @@ -700,7 +700,7 @@ private static MethodInfo MaxAsync__TSource__3__0(Type TSource) =>
(s_MaxAsync__TSource__3__0 ??
(s_MaxAsync__TSource__3__0 = new Func<IAsyncQueryable<object>, IComparer<object>, CancellationToken, ValueTask<object>>(MaxAsync<object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);

public static ValueTask<TSource> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource> comparer, CancellationToken cancellationToken = default)
public static ValueTask<TSource> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down Expand Up @@ -762,7 +762,7 @@ private static MethodInfo MaxByAsync__TSource_TKey__4__0(Type TSource, Type TKey
(s_MaxByAsync__TSource_TKey__4__0 ??
(s_MaxByAsync__TSource_TKey__4__0 = new Func<IAsyncQueryable<object>, Expression<Func<object, CancellationToken, ValueTask<object>>>, IComparer<object>, CancellationToken, ValueTask<IList<object>>>(MaxByAsync<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static ValueTask<IList<TSource>> MaxByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken = default)
public static ValueTask<IList<TSource>> MaxByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -778,7 +778,7 @@ private static MethodInfo MaxByAsync__TSource_TKey__4__1(Type TSource, Type TKey
(s_MaxByAsync__TSource_TKey__4__1 ??
(s_MaxByAsync__TSource_TKey__4__1 = new Func<IAsyncQueryable<object>, Expression<Func<object, object>>, IComparer<object>, CancellationToken, ValueTask<IList<object>>>(MaxByAsync<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static ValueTask<IList<TSource>> MaxByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken = default)
public static ValueTask<IList<TSource>> MaxByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -794,7 +794,7 @@ private static MethodInfo MaxByAsync__TSource_TKey__4__2(Type TSource, Type TKey
(s_MaxByAsync__TSource_TKey__4__2 ??
(s_MaxByAsync__TSource_TKey__4__2 = new Func<IAsyncQueryable<object>, Expression<Func<object, ValueTask<object>>>, IComparer<object>, CancellationToken, ValueTask<IList<object>>>(MaxByAsync<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static ValueTask<IList<TSource>> MaxByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken = default)
public static ValueTask<IList<TSource>> MaxByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down Expand Up @@ -824,7 +824,7 @@ private static MethodInfo MinAsync__TSource__3__0(Type TSource) =>
(s_MinAsync__TSource__3__0 ??
(s_MinAsync__TSource__3__0 = new Func<IAsyncQueryable<object>, IComparer<object>, CancellationToken, ValueTask<object>>(MinAsync<object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);

public static ValueTask<TSource> MinAsync<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource> comparer, CancellationToken cancellationToken = default)
public static ValueTask<TSource> MinAsync<TSource>(this IAsyncQueryable<TSource> source, IComparer<TSource>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down Expand Up @@ -886,7 +886,7 @@ private static MethodInfo MinByAsync__TSource_TKey__4__0(Type TSource, Type TKey
(s_MinByAsync__TSource_TKey__4__0 ??
(s_MinByAsync__TSource_TKey__4__0 = new Func<IAsyncQueryable<object>, Expression<Func<object, CancellationToken, ValueTask<object>>>, IComparer<object>, CancellationToken, ValueTask<IList<object>>>(MinByAsync<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static ValueTask<IList<TSource>> MinByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken = default)
public static ValueTask<IList<TSource>> MinByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -902,7 +902,7 @@ private static MethodInfo MinByAsync__TSource_TKey__4__1(Type TSource, Type TKey
(s_MinByAsync__TSource_TKey__4__1 ??
(s_MinByAsync__TSource_TKey__4__1 = new Func<IAsyncQueryable<object>, Expression<Func<object, object>>, IComparer<object>, CancellationToken, ValueTask<IList<object>>>(MinByAsync<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static ValueTask<IList<TSource>> MinByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken = default)
public static ValueTask<IList<TSource>> MinByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand All @@ -918,7 +918,7 @@ private static MethodInfo MinByAsync__TSource_TKey__4__2(Type TSource, Type TKey
(s_MinByAsync__TSource_TKey__4__2 ??
(s_MinByAsync__TSource_TKey__4__2 = new Func<IAsyncQueryable<object>, Expression<Func<object, ValueTask<object>>>, IComparer<object>, CancellationToken, ValueTask<IList<object>>>(MinByAsync<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);

public static ValueTask<IList<TSource>> MinByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer, CancellationToken cancellationToken = default)
public static ValueTask<IList<TSource>> MinByAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey>? comparer, CancellationToken cancellationToken = default)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
// See the LICENSE file in the project root for more information.

<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="$(ProjectDir)\..\System.Linq.Async\bin\$(Configuration)\net46\System.Threading.Tasks.Extensions.dll" #>
<#@ assembly name="$(ProjectDir)\..\System.Linq.Async\bin\$(Configuration)\net46\System.Linq.Async.dll" #>
<#@ assembly name="$(ProjectDir)\..\System.Interactive.Async\bin\$(Configuration)\net46\System.Interactive.Async.dll" #>
<#@ assembly name="$(ProjectDir)\..\System.Linq.Async\bin\$(Configuration)\net461\Microsoft.Bcl.AsyncInterfaces.dll" #>
<#@ assembly name="$(ProjectDir)\..\System.Linq.Async\bin\$(Configuration)\net461\System.Threading.Tasks.Extensions.dll" #>
<#@ assembly name="$(ProjectDir)\..\System.Linq.Async\bin\$(Configuration)\net461\System.Linq.Async.dll" #>
<#@ assembly name="$(ProjectDir)\..\System.Interactive.Async\bin\$(Configuration)\net461\System.Interactive.Async.dll" #>
<#@ output extension=".cs" #>
<#
var asyncEnumerableType = typeof(AsyncEnumerableEx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AssemblyTitle>Interactive Extensions - Async Library</AssemblyTitle>
<TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
<PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
<NullableContextOptions>enable</NullableContextOptions>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public static IAsyncEnumerable<TSource> Amb<TSource>(this IAsyncEnumerable<TSour

async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
{
IAsyncEnumerator<TSource> firstEnumerator = null;
IAsyncEnumerator<TSource> secondEnumerator = null;
IAsyncEnumerator<TSource>? firstEnumerator = null;
IAsyncEnumerator<TSource>? secondEnumerator = null;

Task<bool> firstMoveNext = null;
Task<bool> secondMoveNext = null;
Task<bool>? firstMoveNext = null;
Task<bool>? secondMoveNext = null;

try
{
Expand Down Expand Up @@ -228,7 +228,7 @@ public static IAsyncEnumerable<TSource> Amb<TSource>(this IEnumerable<IAsyncEnum
return Amb(sources.ToArray());
}

private static async Task AwaitMoveNextAsyncAndDispose<T>(Task<bool> moveNextAsync, IAsyncEnumerator<T> enumerator)
private static async Task AwaitMoveNextAsyncAndDispose<T>(Task<bool>? moveNextAsync, IAsyncEnumerator<T>? enumerator)
{
if (enumerator != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
{
while (true)
{
var c = default(TSource);
TSource c;

try
{
Expand Down Expand Up @@ -95,7 +95,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
{
while (true)
{
var c = default(TSource);
TSource c;

try
{
Expand Down Expand Up @@ -150,7 +150,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
{
while (true)
{
var c = default(TSource);
TSource c;

try
{
Expand Down Expand Up @@ -222,7 +222,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)

while (true)
{
var c = default(TSource);
TSource c;

try
{
Expand Down
Loading

0 comments on commit f329683

Please sign in to comment.