Skip to content

Commit 5179cda

Browse files
authored
Merge pull request #108 from codemerx/feature/async-upgrades
Async improvements
2 parents b1ba69b + ef52ed4 commit 5179cda

File tree

122 files changed

+9577
-2784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+9577
-2784
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
name: Build in Release
1818

1919
on:
20-
workflow_dispatch:
2120
push:
2221
branches:
2322
- master
23+
pull_request:
2424

2525
jobs:
2626
test-on-windows:

engine/Decompiler.Tests/Decompiler.Tests.csproj

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
<Compile Remove="Integration\Expected\Mono.Cecil\**" />
3737
<Compile Remove="Integration\Expected\OrchardCore\**" />
3838
<Compile Remove="Integration\Expected\Piranha\**" />
39+
<Compile Remove="Integration\Expected\AsyncEnumTest\**" />
40+
<Compile Remove="Integration\Expected\AsyncTestCollectionNet45VS2013Debug\**" />
41+
<Compile Remove="Integration\Expected\AsyncTestCollectionNet45VS2013Release\**" />
42+
<Compile Remove="Integration\Expected\AsyncTestCollectionNet6VS2022Debug\**" />
43+
<Compile Remove="Integration\Expected\AsyncTestCollectionNet6VS2022Release\**" />
3944
<Compile Remove="Integration\Expected\Squidex.7.2.0.Net6\**" />
4045
<Compile Remove="Integration\Expected\coolstore.ShoppingCart.Net6\**" />
4146
<Compile Remove="Integration\Expected\clean-architecture-manga.accounts-api.Net7\**" />
@@ -48,6 +53,11 @@
4853
<EmbeddedResource Remove="Integration\Expected\Mono.Cecil\**" />
4954
<EmbeddedResource Remove="Integration\Expected\OrchardCore\**" />
5055
<EmbeddedResource Remove="Integration\Expected\Piranha\**" />
56+
<EmbeddedResource Remove="Integration\Expected\AsyncEnumTest\**" />
57+
<EmbeddedResource Remove="Integration\Expected\AsyncTestCollectionNet45VS2013Debug\**" />
58+
<EmbeddedResource Remove="Integration\Expected\AsyncTestCollectionNet45VS2013Release\**" />
59+
<EmbeddedResource Remove="Integration\Expected\AsyncTestCollectionNet6VS2022Debug\**" />
60+
<EmbeddedResource Remove="Integration\Expected\AsyncTestCollectionNet6VS2022Release\**" />
5161
<EmbeddedResource Remove="Integration\Expected\Squidex.7.2.0.Net6\**" />
5262
<EmbeddedResource Remove="Integration\Expected\coolstore.ShoppingCart.Net6\**" />
5363
<EmbeddedResource Remove="Integration\Expected\clean-architecture-manga.accounts-api.Net7\**" />
@@ -60,6 +70,11 @@
6070
<None Remove="Integration\Expected\Mono.Cecil\**" />
6171
<None Remove="Integration\Expected\OrchardCore\**" />
6272
<None Remove="Integration\Expected\Piranha\**" />
73+
<None Remove="Integration\Expected\AsyncEnumTest\**" />
74+
<None Remove="Integration\Expected\AsyncTestCollectionNet45VS2013Debug\**" />
75+
<None Remove="Integration\Expected\AsyncTestCollectionNet45VS2013Release\**" />
76+
<None Remove="Integration\Expected\AsyncTestCollectionNet6VS2022Debug\**" />
77+
<None Remove="Integration\Expected\AsyncTestCollectionNet6VS2022Release\**" />
6378
<None Remove="Integration\Expected\Squidex.7.2.0.Net6\**" />
6479
<None Remove="Integration\Expected\coolstore.ShoppingCart.Net6\**" />
6580
<None Remove="Integration\Expected\clean-architecture-manga.accounts-api.Net7\**" />
@@ -76,6 +91,11 @@
7691
<None Remove="Integration\Resources\Mix.Cms.Lib\Mix.Cms.Lib.dll" />
7792
<None Remove="Integration\Resources\OrchardCore\OrchardCore.dll" />
7893
<None Remove="Integration\Resources\Piranha\Piranha.dll" />
94+
<None Remove="Integration\Resources\AsyncEnumTest\AsyncEnumTest.dll" />
95+
<None Remove="Integration\Resources\AsyncTestCollectionNet45VS2013Debug\AsyncTestCollectionNet45VS2013.dll" />
96+
<None Remove="Integration\Resources\AsyncTestCollectionNet45VS2013Release\AsyncTestCollectionNet45VS2013.dll" />
97+
<None Remove="Integration\Resources\AsyncTestCollectionNet6VS2022Debug\AsyncTestCollectionNet6VS2022.dll" />
98+
<None Remove="Integration\Resources\AsyncTestCollectionNet6VS2022Release\AsyncTestCollectionNet6VS2022.dll" />
7999
<None Remove="Integration\Resources\Squidex.7.2.0.Net6\Squidex.dll" />
80100
<None Remove="Integration\Resources\coolstore.ShoppingCart.Net6\ShoppingCart.dll" />
81101
<None Remove="Integration\Resources\clean-architecture-manga.accounts-api.Net7\Application.dll" />
@@ -116,6 +136,21 @@
116136
<EmbeddedResource Include="Integration\Resources\Piranha\Piranha.dll">
117137
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
118138
</EmbeddedResource>
139+
<EmbeddedResource Include="Integration\Resources\AsyncEnumTest\AsyncEnumTest.dll">
140+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
141+
</EmbeddedResource>
142+
<EmbeddedResource Include="Integration\Resources\AsyncTestCollectionNet45VS2013Debug\AsyncTestCollectionNet45VS2013.dll">
143+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
144+
</EmbeddedResource>
145+
<EmbeddedResource Include="Integration\Resources\AsyncTestCollectionNet45VS2013Release\AsyncTestCollectionNet45VS2013.dll">
146+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
147+
</EmbeddedResource>
148+
<EmbeddedResource Include="Integration\Resources\AsyncTestCollectionNet6VS2022Debug\AsyncTestCollectionNet6VS2022.dll">
149+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
150+
</EmbeddedResource>
151+
<EmbeddedResource Include="Integration\Resources\AsyncTestCollectionNet6VS2022Release\AsyncTestCollectionNet6VS2022.dll">
152+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
153+
</EmbeddedResource>
119154
<EmbeddedResource Include="Integration\Resources\Squidex.7.2.0.Net6\Squidex.dll">
120155
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
121156
</EmbeddedResource>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ProjectGuid>{626927AE-4E7F-4E2A-8D22-8D1EDC2A3636}</ProjectGuid>
5+
<SchemaVersion>2</SchemaVersion>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<AssemblyName>AsyncEnumTest</AssemblyName>
9+
<OutputType>Exe</OutputType>
10+
</PropertyGroup>
11+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
12+
<OutputPath>bin\Debug\</OutputPath>
13+
<DebugSymbols>true</DebugSymbols>
14+
<DefineConstants>DEBUG;TRACE</DefineConstants>
15+
<Optimize>false</Optimize>
16+
<WarningLevel>4</WarningLevel>
17+
<DebugType>full</DebugType>
18+
<ErrorReport>prompt</ErrorReport>
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
</PropertyGroup>
21+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
22+
<OutputPath>bin\Release\</OutputPath>
23+
<DebugSymbols>false</DebugSymbols>
24+
<DefineConstants>TRACE</DefineConstants>
25+
<Optimize>true</Optimize>
26+
<WarningLevel>4</WarningLevel>
27+
<DebugType>pdbonly</DebugType>
28+
<ErrorReport>prompt</ErrorReport>
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
</PropertyGroup>
31+
<ItemGroup>
32+
<Reference Include="System.Runtime">
33+
<HintPath>.\AsyncEnumTestReferences\System.Runtime.dll</HintPath>
34+
</Reference>
35+
<Reference Include="System.Console">
36+
<HintPath>.\AsyncEnumTestReferences\System.Console.dll</HintPath>
37+
</Reference>
38+
<Reference Include="System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" />
39+
</ItemGroup>
40+
<ItemGroup>
41+
<Compile Include="Properties\AssemblyInfo.cs">
42+
<AutoGen>false</AutoGen>
43+
<DesignTimeSharedInput>false</DesignTimeSharedInput>
44+
</Compile>
45+
<Compile Include="AsyncEnumTest\Program.cs">
46+
<AutoGen>false</AutoGen>
47+
<DesignTimeSharedInput>false</DesignTimeSharedInput>
48+
</Compile>
49+
</ItemGroup>
50+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
51+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Microsoft Visual Studio Solution File, Format Version 11.00
2+
# Visual Studio 2010
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncEnumTest", "AsyncEnumTest.csproj", "{626927AE-4E7F-4E2A-8D22-8D1EDC2A3636}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{626927AE-4E7F-4E2A-8D22-8D1EDC2A3636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{626927AE-4E7F-4E2A-8D22-8D1EDC2A3636}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{626927AE-4E7F-4E2A-8D22-8D1EDC2A3636}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{626927AE-4E7F-4E2A-8D22-8D1EDC2A3636}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
GlobalSection(SolutionProperties) = preSolution
17+
HideSolutionNode = FALSE
18+
EndGlobalSection
19+
EndGlobal
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Runtime.CompilerServices;
5+
using System.Runtime.ExceptionServices;
6+
using System.Threading;
7+
using System.Threading.Tasks;
8+
using System.Threading.Tasks.Sources;
9+
10+
namespace AsyncEnumTest
11+
{
12+
[Nullable(0)]
13+
[NullableContext(1)]
14+
internal class Program
15+
{
16+
public Program()
17+
{
18+
}
19+
20+
[DebuggerStepThrough]
21+
// <Main>
22+
private static void u003cMainu003e(string[] args)
23+
{
24+
Program.Main(args).GetAwaiter().GetResult();
25+
}
26+
27+
private static async Task loop()
28+
{
29+
object obj;
30+
IAsyncEnumerable<int> asyncEnumerable = Program.RangeAsync(0, 5);
31+
IAsyncEnumerator<int> asyncEnumerator = asyncEnumerable.GetAsyncEnumerator(new CancellationToken());
32+
object obj1 = null;
33+
int num = 0;
34+
try
35+
{
36+
while (true)
37+
{
38+
if (!await asyncEnumerator.MoveNextAsync())
39+
{
40+
break;
41+
}
42+
Console.WriteLine(asyncEnumerator.Current);
43+
}
44+
}
45+
catch
46+
{
47+
obj = obj2;
48+
obj1 = obj;
49+
}
50+
if (asyncEnumerator != null)
51+
{
52+
await asyncEnumerator.DisposeAsync();
53+
}
54+
obj = obj1;
55+
if (obj != null)
56+
{
57+
Exception exception = obj as Exception;
58+
if (exception == null)
59+
{
60+
throw obj;
61+
}
62+
ExceptionDispatchInfo.Capture(exception).Throw();
63+
}
64+
obj1 = null;
65+
asyncEnumerator = null;
66+
}
67+
68+
private static async Task Main(string[] args)
69+
{
70+
await Program.loop();
71+
}
72+
73+
[AsyncIteratorStateMachine(typeof(Program.u003cRangeAsyncu003ed__1))]
74+
private static IAsyncEnumerable<int> RangeAsync(int start, int count)
75+
{
76+
return new Program.u003cRangeAsyncu003ed__1(-2)
77+
{
78+
u003cu003e3__start = start,
79+
u003cu003e3__count = count
80+
};
81+
}
82+
}
83+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Diagnostics;
2+
using System.Reflection;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.Versioning;
5+
6+
[assembly: AssemblyCompany("AsyncEnumTest")]
7+
[assembly: AssemblyConfiguration("Debug")]
8+
[assembly: AssemblyFileVersion("1.0.0.0")]
9+
[assembly: AssemblyInformationalVersion("1.0.0")]
10+
[assembly: AssemblyProduct("AsyncEnumTest")]
11+
[assembly: AssemblyTitle("AsyncEnumTest")]
12+
[assembly: AssemblyVersion("1.0.0.0")]
13+
[assembly: CompilationRelaxations(8)]
14+
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
15+
[assembly: RuntimeCompatibility(WrapNonExceptionThrows=true)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ProjectGuid>{01FEA9C3-8E31-47FD-8969-61EBB79BE04A}</ProjectGuid>
5+
<SchemaVersion>2</SchemaVersion>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
8+
<AssemblyName>AsyncTestCollectionNet45VS2013</AssemblyName>
9+
<OutputType>Exe</OutputType>
10+
<RootNamespace>AsyncTestCollectionNet45VS2013</RootNamespace>
11+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12+
</PropertyGroup>
13+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
14+
<OutputPath>bin\Debug\</OutputPath>
15+
<DebugSymbols>true</DebugSymbols>
16+
<DefineConstants>DEBUG;TRACE</DefineConstants>
17+
<Optimize>false</Optimize>
18+
<WarningLevel>4</WarningLevel>
19+
<DebugType>full</DebugType>
20+
<ErrorReport>prompt</ErrorReport>
21+
<PlatformTarget>x86</PlatformTarget>
22+
</PropertyGroup>
23+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
24+
<OutputPath>bin\Release\</OutputPath>
25+
<DebugSymbols>false</DebugSymbols>
26+
<DefineConstants>TRACE</DefineConstants>
27+
<Optimize>true</Optimize>
28+
<WarningLevel>4</WarningLevel>
29+
<DebugType>pdbonly</DebugType>
30+
<ErrorReport>prompt</ErrorReport>
31+
<PlatformTarget>x86</PlatformTarget>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="System.Core" />
35+
</ItemGroup>
36+
<ItemGroup>
37+
<Compile Include="Properties\AssemblyInfo.cs">
38+
<AutoGen>false</AutoGen>
39+
<DesignTimeSharedInput>false</DesignTimeSharedInput>
40+
</Compile>
41+
<Compile Include="Program.cs">
42+
<AutoGen>false</AutoGen>
43+
<DesignTimeSharedInput>false</DesignTimeSharedInput>
44+
</Compile>
45+
</ItemGroup>
46+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
47+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Microsoft Visual Studio Solution File, Format Version 11.00
2+
# Visual Studio 2010
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncTestCollectionNet45VS2013", "AsyncTestCollectionNet45VS2013.csproj", "{01FEA9C3-8E31-47FD-8969-61EBB79BE04A}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|x86 = Debug|x86
8+
Release|x86 = Release|x86
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{01FEA9C3-8E31-47FD-8969-61EBB79BE04A}.Debug|x86.ActiveCfg = Debug|x86
12+
{01FEA9C3-8E31-47FD-8969-61EBB79BE04A}.Debug|x86.Build.0 = Debug|x86
13+
{01FEA9C3-8E31-47FD-8969-61EBB79BE04A}.Release|x86.ActiveCfg = Release|x86
14+
{01FEA9C3-8E31-47FD-8969-61EBB79BE04A}.Release|x86.Build.0 = Release|x86
15+
EndGlobalSection
16+
GlobalSection(SolutionProperties) = preSolution
17+
HideSolutionNode = FALSE
18+
EndGlobalSection
19+
EndGlobal

0 commit comments

Comments
 (0)