Skip to content

Commit

Permalink
Fix sync ValueTask returns, update packages, increment version
Browse files Browse the repository at this point in the history
  • Loading branch information
mikernet committed Sep 21, 2023
1 parent f62b7d1 commit d9fcc65
Show file tree
Hide file tree
Showing 55 changed files with 1,329 additions and 1,028 deletions.
5 changes: 2 additions & 3 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Nullable>enable</Nullable>
<AnnotatedReferenceAssemblyVersion>6.0.0</AnnotatedReferenceAssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.0.5</Version>
<Version>1.0.6</Version>
<DefineConstants Condition="'$(IsCI)' == 'true'">$(DefineConstants);CI</DefineConstants>
</PropertyGroup>

Expand All @@ -15,9 +15,8 @@
<ItemGroup>
<!-- Analyzers -->
<PackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0" PrivateAssets="all" />
<PackageReference Include="Roslynator.Analyzers" Version="4.5.0" PrivateAssets="all" />

<!-- Nullable Annotations -->
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<!-- CS1591 Missing XML comment for publicly visible type or member. -->
<NoWarn>1591</NoWarn>
<IsPackable>false</IsPackable>
Expand All @@ -18,11 +18,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FodyHelpers" Version="6.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="Verify.MSTest" Version="19.5.0" />
<PackageReference Include="FodyHelpers" Version="6.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="Verify.MSTest" Version="21.1.5" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 12 additions & 0 deletions Source/RuntimeNullables.Fody.Tests/TaskResultTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ public Task BadReferenceAsyncWithoutAwait()
return Assert.ThrowsExceptionAsync<NullReferenceException>(() => TaskResults.BadReferenceAsyncWithoutAwait());
}

[TestMethod]
public Task GoodReferenceValue()
{
return TaskResults.GoodReferenceValue().AsTask();
}

[TestMethod]
public Task BadReferenceValue()
{
return Assert.ThrowsExceptionAsync<NullReferenceException>(() => TaskResults.BadReferenceValue().AsTask());
}

[TestMethod]
public Task GoodReferenceValueAsync()
{
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ IL_0007: ldarg.0
IL_0008: ldarg.1
IL_0009: stfld int32 class TestAssembly.Enumerables/'<BadGetGenerics>d__3`1'<!T>::'<>1__state'
IL_000e: ldarg.0
IL_000f: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000f: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0014: stfld int32 class TestAssembly.Enumerables/'<BadGetGenerics>d__3`1'<!T>::'<>l__initialThreadId'
IL_0019: ret
}
Expand Down Expand Up @@ -173,7 +173,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 class TestAssembly.Enumerables/'<BadGetGenerics>d__3`1'<!T>::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -238,7 +238,7 @@ IL_0007: ldarg.0
IL_0008: ldarg.1
IL_0009: stfld int32 TestAssembly.Enumerables/'<BadGetReferences>d__1'::'<>1__state'
IL_000e: ldarg.0
IL_000f: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000f: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0014: stfld int32 TestAssembly.Enumerables/'<BadGetReferences>d__1'::'<>l__initialThreadId'
IL_0019: ret
}
Expand Down Expand Up @@ -369,7 +369,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 TestAssembly.Enumerables/'<BadGetReferences>d__1'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -435,7 +435,7 @@ IL_0007: ldarg.0
IL_0008: ldarg.1
IL_0009: stfld int32 TestAssembly.Enumerables/'<GetNullNonGenerics>d__4'::'<>1__state'
IL_000e: ldarg.0
IL_000f: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000f: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0014: stfld int32 TestAssembly.Enumerables/'<GetNullNonGenerics>d__4'::'<>l__initialThreadId'
IL_0019: ret
}
Expand Down Expand Up @@ -529,7 +529,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 TestAssembly.Enumerables/'<GetNullNonGenerics>d__4'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -595,7 +595,7 @@ IL_0007: ldarg.0
IL_0008: ldarg.1
IL_0009: stfld int32 class TestAssembly.Enumerables/'<GoodGetGenerics>d__2`1'<!T>::'<>1__state'
IL_000e: ldarg.0
IL_000f: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000f: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0014: stfld int32 class TestAssembly.Enumerables/'<GoodGetGenerics>d__2`1'<!T>::'<>l__initialThreadId'
IL_0019: ret
}
Expand Down Expand Up @@ -770,7 +770,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 class TestAssembly.Enumerables/'<GoodGetGenerics>d__2`1'<!T>::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -835,7 +835,7 @@ IL_0007: ldarg.0
IL_0008: ldarg.1
IL_0009: stfld int32 TestAssembly.Enumerables/'<GoodGetReferences>d__0'::'<>1__state'
IL_000e: ldarg.0
IL_000f: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000f: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0014: stfld int32 TestAssembly.Enumerables/'<GoodGetReferences>d__0'::'<>l__initialThreadId'
IL_0019: ret
}
Expand Down Expand Up @@ -1002,7 +1002,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 TestAssembly.Enumerables/'<GoodGetReferences>d__0'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 class TestAssembly.Enumerables/'<BadGetGenerics>d__3`1'<!T>::'<>1__state'
IL_000d: ldarg.0
IL_000e: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000e: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0013: stfld int32 class TestAssembly.Enumerables/'<BadGetGenerics>d__3`1'<!T>::'<>l__initialThreadId'
IL_0018: ret
}
Expand Down Expand Up @@ -166,7 +166,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 class TestAssembly.Enumerables/'<BadGetGenerics>d__3`1'<!T>::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -230,7 +230,7 @@ IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 TestAssembly.Enumerables/'<BadGetReferences>d__1'::'<>1__state'
IL_000d: ldarg.0
IL_000e: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000e: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0013: stfld int32 TestAssembly.Enumerables/'<BadGetReferences>d__1'::'<>l__initialThreadId'
IL_0018: ret
}
Expand Down Expand Up @@ -355,7 +355,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 TestAssembly.Enumerables/'<BadGetReferences>d__1'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -420,7 +420,7 @@ IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 TestAssembly.Enumerables/'<GetNullNonGenerics>d__4'::'<>1__state'
IL_000d: ldarg.0
IL_000e: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000e: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0013: stfld int32 TestAssembly.Enumerables/'<GetNullNonGenerics>d__4'::'<>l__initialThreadId'
IL_0018: ret
}
Expand Down Expand Up @@ -509,7 +509,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 TestAssembly.Enumerables/'<GetNullNonGenerics>d__4'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -574,7 +574,7 @@ IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 class TestAssembly.Enumerables/'<GoodGetGenerics>d__2`1'<!T>::'<>1__state'
IL_000d: ldarg.0
IL_000e: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000e: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0013: stfld int32 class TestAssembly.Enumerables/'<GoodGetGenerics>d__2`1'<!T>::'<>l__initialThreadId'
IL_0018: ret
}
Expand Down Expand Up @@ -741,7 +741,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 class TestAssembly.Enumerables/'<GoodGetGenerics>d__2`1'<!T>::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down Expand Up @@ -805,7 +805,7 @@ IL_0006: ldarg.0
IL_0007: ldarg.1
IL_0008: stfld int32 TestAssembly.Enumerables/'<GoodGetReferences>d__0'::'<>1__state'
IL_000d: ldarg.0
IL_000e: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_000e: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0013: stfld int32 TestAssembly.Enumerables/'<GoodGetReferences>d__0'::'<>l__initialThreadId'
IL_0018: ret
}
Expand Down Expand Up @@ -964,7 +964,7 @@ IL_0006: ldc.i4.s -2
IL_0008: bne.un.s IL_0022
IL_000a: ldarg.0
IL_000b: ldfld int32 TestAssembly.Enumerables/'<GoodGetReferences>d__0'::'<>l__initialThreadId'
IL_0010: call int32 [System.Runtime.Extensions]System.Environment::get_CurrentManagedThreadId()
IL_0010: call int32 [System.Runtime]System.Environment::get_CurrentManagedThreadId()
IL_0015: bne.un.s IL_0022
IL_0017: ldarg.0
IL_0018: ldc.i4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extends [System.Runtime]System.Object
{
string) = ( 01 00 15 52 75 6E 74 69 6D 65 4E 75 6C 6C 61 62 // ...RuntimeNullab
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 35 00 00 ) // les.Fody.1.0.5..
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 36 00 00 ) // les.Fody.1.0.6..
.method assembly hidebysig static void
ThrowArgumentNull(string paramName) cil managed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extends [System.Runtime]System.Object
{
string) = ( 01 00 15 52 75 6E 74 69 6D 65 4E 75 6C 6C 61 62 // ...RuntimeNullab
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 35 00 00 ) // les.Fody.1.0.5..
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 36 00 00 ) // les.Fody.1.0.6..
.method assembly hidebysig static void
ThrowArgumentNull(string paramName) cil managed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extends [System.Runtime]System.Object
{
string) = ( 01 00 15 52 75 6E 74 69 6D 65 4E 75 6C 6C 61 62 // ...RuntimeNullab
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 35 00 00 ) // les.Fody.1.0.5..
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 36 00 00 ) // les.Fody.1.0.6..
.method assembly hidebysig static void
ThrowArgumentNull(string paramName) cil managed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extends [System.Runtime]System.Object
{
string) = ( 01 00 15 52 75 6E 74 69 6D 65 4E 75 6C 6C 61 62 // ...RuntimeNullab
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 35 00 00 ) // les.Fody.1.0.5..
6C 65 73 2E 46 6F 64 79 05 31 2E 30 2E 36 00 00 ) // les.Fody.1.0.6..
.method assembly hidebysig static void
ThrowArgumentNull(string paramName) cil managed
{
Expand Down
Loading

0 comments on commit d9fcc65

Please sign in to comment.