diff --git a/.gitignore b/.gitignore
index 0c35f3bd6918..88e4f6ab632a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,9 +11,6 @@ syntax: glob
.packages
.tools
-# nuget packages for custom roslyn
-roslynpackages
-
# User-specific files
*.suo
*.user
diff --git a/NuGet.config b/NuGet.config
index f05e91436c2e..335f51a80849 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -19,7 +19,7 @@
-
+
diff --git a/buildroslynnugets.cmd b/buildroslynnugets.cmd
deleted file mode 100644
index 8588fe576649..000000000000
--- a/buildroslynnugets.cmd
+++ /dev/null
@@ -1,34 +0,0 @@
-setlocal ENABLEEXTENSIONS
-pushd %~dp0
-set ASYNC_ROSLYN_COMMIT=792910b18a652dbf46bf292ee66dec974e39da9b
-set ASYNC_SUFFIX=async-15
-set ASYNC_ROSLYN_BRANCH=demos/async2-experiment1
-
-cd ..
-if not exist async-roslyn-repo git clone -b %ASYNC_ROSLYN_BRANCH% -o async_roslyn_remote https://github.com/dotnet/roslyn.git async-roslyn-repo
-
-pushd async-roslyn-repo
-
-git fetch async_roslyn_remote %ASYNC_ROSLYN_BRANCH%
-rem when updating this, make sure to update the ASYNC_SUFFIX above and the versions.props file
-git checkout %ASYNC_ROSLYN_COMMIT%
-
-call restore.cmd
-call build.cmd -c release
-
-call dotnet pack src\NuGet\Microsoft.Net.Compilers.Toolset\AnyCpu\Microsoft.Net.Compilers.Toolset.Package.csproj --version-suffix %ASYNC_SUFFIX%
-call dotnet pack src\Workspaces\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.Workspaces.csproj --version-suffix %ASYNC_SUFFIX%
-call dotnet pack src\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj --version-suffix %ASYNC_SUFFIX%
-call dotnet pack src\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj --version-suffix %ASYNC_SUFFIX%
-call dotnet pack src\Workspaces\Core\Portable\Microsoft.CodeAnalysis.Workspaces.csproj --version-suffix %ASYNC_SUFFIX%
-
-pushd %~dp0
-
-md roslynpackages
-
-copy ..\async-roslyn-repo\artifacts\packages\Release\Shipping\Microsoft.Net.Compilers.Toolset.4.14.0-%ASYNC_SUFFIX%.nupkg roslynpackages
-copy ..\async-roslyn-repo\artifacts\packages\Release\Shipping\Microsoft.CodeAnalysis.Workspaces.Common.4.14.0-%ASYNC_SUFFIX%.nupkg roslynpackages
-copy ..\async-roslyn-repo\artifacts\packages\Release\Shipping\Microsoft.CodeAnalysis.CSharp.Workspaces.4.14.0-%ASYNC_SUFFIX%.nupkg roslynpackages
-copy ..\async-roslyn-repo\artifacts\packages\Release\Shipping\Microsoft.CodeAnalysis.CSharp.4.14.0-%ASYNC_SUFFIX%.nupkg roslynpackages
-copy ..\async-roslyn-repo\artifacts\packages\Release\Shipping\Microsoft.CodeAnalysis.Common.4.14.0-%ASYNC_SUFFIX%.nupkg roslynpackages
-
diff --git a/eng/Versions.props b/eng/Versions.props
index fbdc2de9c61a..1b071b2f99e4 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -44,9 +44,10 @@
Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure
they do not break the local dev experience.
-->
- 4.14.0-async-15
- 4.14.0-async-15
- 4.14.0-async-15
+
+ 4.13.0-3.24611.10
+ $(MicrosoftCodeAnalysisCSharpVersion)
+ $(MicrosoftCodeAnalysisCSharpVersion)
+ 5.0.0-1.25258.11
+
+
true
diff --git a/src/tests/async/Directory.Build.props b/src/tests/async/Directory.Build.props
new file mode 100644
index 000000000000..06c34511cb11
--- /dev/null
+++ b/src/tests/async/Directory.Build.props
@@ -0,0 +1,9 @@
+
+
+
+ $(Features);runtime-async=on
+
+
+
+
+
\ No newline at end of file
diff --git a/src/tests/async/RuntimeAsyncMethodGenerationAttribute.cs b/src/tests/async/RuntimeAsyncMethodGenerationAttribute.cs
new file mode 100644
index 000000000000..2ae84c6fcccd
--- /dev/null
+++ b/src/tests/async/RuntimeAsyncMethodGenerationAttribute.cs
@@ -0,0 +1,6 @@
+namespace System.Runtime.CompilerServices;
+[AttributeUsage(AttributeTargets.Method)]
+public class RuntimeAsyncMethodGenerationAttribute(bool runtimeAsync) : Attribute
+{
+ public bool RuntimeAsync { get; } = runtimeAsync;
+}
\ No newline at end of file
diff --git a/src/tests/async/awaitingnotasync.cs b/src/tests/async/awaitingnotasync.cs
index 9f4b1732313c..2eefa3a6f2af 100644
--- a/src/tests/async/awaitingnotasync.cs
+++ b/src/tests/async/awaitingnotasync.cs
@@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Xunit;
@@ -14,6 +13,7 @@ public static void TestEntryPoint()
AsyncEntryPoint().Wait();
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task GetTask(T arg)
{
await Task.Yield();
@@ -21,6 +21,7 @@ private static async Task GetTask(T arg)
}
// TODO: switch every other scenario to use ValueTask
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async ValueTask GetValueTask(T arg)
{
await Task.Yield();
@@ -33,13 +34,14 @@ private static async ValueTask GetValueTask(T arg)
private static T sIdentity(T arg) => arg;
- private static async2 Task AsyncEntryPoint()
+ [MethodImpl(MethodImplOptions.Async)]
+ private static async Task AsyncEntryPoint()
{
// static field
sField = GetTask(5);
Assert.Equal(5, await sField);
- // property
+ // property
Assert.Equal(6, await sProp);
// generic identity
diff --git a/src/tests/async/collectible-alc.cs b/src/tests/async/collectible-alc.cs
index eb7e43309db2..0feb988d4ac4 100644
--- a/src/tests/async/collectible-alc.cs
+++ b/src/tests/async/collectible-alc.cs
@@ -17,7 +17,7 @@ public static void TestEntryPoint()
AsyncEntryPoint().Wait();
}
- private static async2 Task AsyncEntryPoint()
+ private static async Task AsyncEntryPoint()
{
WeakReference wr = await CallFooAsyncAndUnload();
@@ -31,7 +31,7 @@ private static async2 Task AsyncEntryPoint()
}
[MethodImpl(MethodImplOptions.NoInlining)]
- private static async2 Task CallFooAsyncAndUnload()
+ private static async Task CallFooAsyncAndUnload()
{
TaskCompletionSource tcs = new();
(Task task, WeakReference wr) = CallFooAsyncInCollectibleALC(tcs.Task);
@@ -63,7 +63,7 @@ private static (Task, WeakReference) CallFooAsyncInCollectibleALC(Task t
}
// Task[] to work around a compiler bug
- private static async2 Task FooAsync(Task[] t)
+ private static async Task FooAsync(Task[] t)
{
await t[0];
return "done";
diff --git a/src/tests/async/collectible-alc.csproj b/src/tests/async/collectible-alc.csproj
index 3b3ebe1336c1..97ccb4252e97 100644
--- a/src/tests/async/collectible-alc.csproj
+++ b/src/tests/async/collectible-alc.csproj
@@ -3,6 +3,7 @@
True
True
+ $(Features);runtime-async
diff --git a/src/tests/async/cse-array-index-byref.cs b/src/tests/async/cse-array-index-byref.cs
index be99722a054b..3aef0c7dadf3 100644
--- a/src/tests/async/cse-array-index-byref.cs
+++ b/src/tests/async/cse-array-index-byref.cs
@@ -16,13 +16,14 @@ public static void TestEntryPoint()
Assert.Equal(199_990_000, arr[0]);
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task AsyncTestEntryPoint(int[] arr, int index)
{
await HoistedByref(arr, index);
}
- [MethodImpl(MethodImplOptions.NoInlining)]
- private static async2 Task HoistedByref(int[] arr, int index)
+ [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)]
+ private static async Task HoistedByref(int[] arr, int index)
{
for (int i = 0; i < 20000; i++)
{
diff --git a/src/tests/async/eh-microbench.cs b/src/tests/async/eh-microbench.cs
index 994e443cf9e3..2eefa61570a8 100644
--- a/src/tests/async/eh-microbench.cs
+++ b/src/tests/async/eh-microbench.cs
@@ -24,6 +24,7 @@ public static int Main()
return 100;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
public static async Task AsyncEntry()
{
if (!GCSettings.IsServerGC)
@@ -68,6 +69,7 @@ public static async Task AsyncEntry()
await RunBench(yieldFrequency, depth, finallyRate, throwOrReturn, "ValueTask");
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task RunBench(int yieldCount, int depth, int finallyRate, bool throwOrReturn, string type)
{
@@ -104,7 +106,7 @@ public Benchmark(int yieldCount, int depth, int finallyRate, bool throwOrReturn)
_throwOrReturn = throwOrReturn;
}
- public async2 Task Run(string type)
+ public async Task Run(string type)
{
if (type == "Async2")
return await RunAsync2(_depth);
@@ -117,6 +119,7 @@ public async2 Task Run(string type)
return 0;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
public async Task RunTask(int depth)
{
int liveState1 = depth * 3 + _yieldCount;
@@ -182,6 +185,7 @@ public async Task RunTask(int depth)
return result;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
public async ValueTask RunValueTask(int depth)
{
int liveState1 = depth * 3 + _yieldCount;
@@ -267,7 +271,7 @@ public class FakeThread
// This case is used to test the impact of save/restore of the sync and execution context on performance
// The intent here is to measure what the performance impact of maintaining the current async semantics with
// the new implementation.
- public async2 Task RunAsync2WithContextSaveRestore(int depth)
+ public async Task RunAsync2WithContextSaveRestore(int depth)
{
FakeThread thread = CurrentThread;
if (thread == null)
@@ -361,7 +365,7 @@ public async2 Task RunAsync2WithContextSaveRestore(int depth)
}
}
- public async2 Task RunAsync2(int depth)
+ public async Task RunAsync2(int depth)
{
int liveState1 = depth * 3 + _yieldCount;
int liveState2 = depth;
diff --git a/src/tests/async/fibonacci-with-yields.cs b/src/tests/async/fibonacci-with-yields.cs
index a51a834fbdd7..e3cacd061cfb 100644
--- a/src/tests/async/fibonacci-with-yields.cs
+++ b/src/tests/async/fibonacci-with-yields.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Diagnostics;
using Xunit;
@@ -22,7 +23,8 @@ public static void Test()
System.Console.WriteLine("allocated: " + allocated);
}
- public static async2 Task AsyncEntry()
+ [MethodImpl(MethodImplOptions.Async)]
+ public static async Task AsyncEntry()
{
for (int i = 0; i < iterations; i++)
{
@@ -34,7 +36,8 @@ public static async2 Task AsyncEntry()
}
}
- static async2 Task Fib(int i)
+ [MethodImpl(MethodImplOptions.Async)]
+ static async Task Fib(int i)
{
if (i <= 1)
{
diff --git a/src/tests/async/fibonacci-with-yields.csproj b/src/tests/async/fibonacci-with-yields.csproj
index de6d5e08882e..b769f499427a 100644
--- a/src/tests/async/fibonacci-with-yields.csproj
+++ b/src/tests/async/fibonacci-with-yields.csproj
@@ -1,6 +1,7 @@
True
+ $(Features);runtime-async
diff --git a/src/tests/async/fibonacci-with-yields_struct_return.cs b/src/tests/async/fibonacci-with-yields_struct_return.cs
index eee23a2c1624..136416c0ba68 100644
--- a/src/tests/async/fibonacci-with-yields_struct_return.cs
+++ b/src/tests/async/fibonacci-with-yields_struct_return.cs
@@ -6,6 +6,7 @@
using System;
using System.Threading.Tasks;
using System.Diagnostics;
+using System.Runtime.CompilerServices;
using Xunit;
public class Async2FibonacceWithYields
@@ -34,7 +35,8 @@ public struct MyInt
public MyInt(int i) => this.i = i;
}
- public static async2 Task AsyncEntry()
+ [MethodImpl(MethodImplOptions.Async)]
+ public static async Task AsyncEntry()
{
for (int i = 0; i < iterations; i++)
{
@@ -46,7 +48,8 @@ public static async2 Task AsyncEntry()
}
}
- static async2 Task Fib(MyInt n)
+ [MethodImpl(MethodImplOptions.Async)]
+ static async Task Fib(MyInt n)
{
int i = n.i;
if (i <= 1)
diff --git a/src/tests/async/fibonacci-with-yields_struct_return.csproj b/src/tests/async/fibonacci-with-yields_struct_return.csproj
index de6d5e08882e..b769f499427a 100644
--- a/src/tests/async/fibonacci-with-yields_struct_return.csproj
+++ b/src/tests/async/fibonacci-with-yields_struct_return.csproj
@@ -1,6 +1,7 @@
True
+ $(Features);runtime-async
diff --git a/src/tests/async/fibonacci-without-yields-config-await.cs b/src/tests/async/fibonacci-without-yields-config-await.cs
index 7abf3bac07de..e82e09aa9214 100644
--- a/src/tests/async/fibonacci-without-yields-config-await.cs
+++ b/src/tests/async/fibonacci-without-yields-config-await.cs
@@ -26,7 +26,8 @@ public static void Test()
System.Console.WriteLine("allocated: " + allocated);
}
- public static async2 Task AsyncEntry()
+ [MethodImpl(MethodImplOptions.Async)]
+ public static async Task AsyncEntry()
{
for (int i = 0; i < iterations; i++)
{
@@ -38,7 +39,8 @@ public static async2 Task AsyncEntry()
}
}
- static async2 Task Fib(int i)
+ [MethodImpl(MethodImplOptions.Async)]
+ static async Task Fib(int i)
{
if (i <= 1)
{
diff --git a/src/tests/async/fibonacci-without-yields.cs b/src/tests/async/fibonacci-without-yields.cs
index 77ff71e8d1ee..47aac15fd8af 100644
--- a/src/tests/async/fibonacci-without-yields.cs
+++ b/src/tests/async/fibonacci-without-yields.cs
@@ -4,6 +4,7 @@
using System;
using System.Threading.Tasks;
using System.Diagnostics;
+using System.Runtime.CompilerServices;
using Xunit;
public class Async2FibonacciWithoutYields
@@ -22,7 +23,8 @@ public static void Test()
System.Console.WriteLine("allocated: " + allocated);
}
- public static async2 Task AsyncEntry()
+ [MethodImpl(MethodImplOptions.Async)]
+ public static async Task AsyncEntry()
{
for (int i = 0; i < iterations; i++)
{
@@ -34,7 +36,8 @@ public static async2 Task AsyncEntry()
}
}
- static async2 Task Fib(int i)
+ [MethodImpl(MethodImplOptions.Async)]
+ static async Task Fib(int i)
{
if (i <= 1)
{
diff --git a/src/tests/async/fibonacci-without-yields.csproj b/src/tests/async/fibonacci-without-yields.csproj
index de6d5e08882e..b769f499427a 100644
--- a/src/tests/async/fibonacci-without-yields.csproj
+++ b/src/tests/async/fibonacci-without-yields.csproj
@@ -1,6 +1,7 @@
True
+ $(Features);runtime-async
diff --git a/src/tests/async/gc-roots-scan.cs b/src/tests/async/gc-roots-scan.cs
index fffe874af38e..256241b74c6a 100644
--- a/src/tests/async/gc-roots-scan.cs
+++ b/src/tests/async/gc-roots-scan.cs
@@ -4,6 +4,7 @@
using System;
using System.Threading.Tasks;
using System.Diagnostics;
+using System.Runtime.CompilerServices;
using Xunit;
public class Async2RootReporting
@@ -11,6 +12,7 @@ public class Async2RootReporting
private static TaskCompletionSource cs;
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
static async Task Recursive1(int n)
{
Task cTask = cs.Task;
@@ -50,7 +52,8 @@ static async Task Recursive1(int n)
return result;
}
- static async2 Task Recursive2(int n)
+ [MethodImpl(MethodImplOptions.Async)]
+ static async Task Recursive2(int n)
{
Task cTask = cs.Task;
diff --git a/src/tests/async/implement.cs b/src/tests/async/implement.cs
index bb8607541d1d..57b9184c64a0 100644
--- a/src/tests/async/implement.cs
+++ b/src/tests/async/implement.cs
@@ -10,11 +10,12 @@ public class Async2Implement
{
interface IBase1
{
- public async2 Task M1();
+ public Task M1();
}
class Derived1 : IBase1
{
+ [RuntimeAsyncMethodGeneration(false)]
public async Task M1()
{
await Task.Yield();
@@ -24,7 +25,8 @@ public async Task M1()
class Derived1a : IBase1
{
- public async2 Task M1()
+ [MethodImpl(MethodImplOptions.Async)]
+ public async Task M1()
{
await Task.Yield();
return 3;
@@ -38,7 +40,8 @@ interface IBase2
class Derived2 : IBase2
{
- public async2 Task M1()
+ [MethodImpl(MethodImplOptions.Async)]
+ public async Task M1()
{
await Task.Yield();
return 12;
@@ -47,6 +50,7 @@ public async2 Task M1()
class Derived2a : IBase2
{
+ [RuntimeAsyncMethodGeneration(false)]
public async Task M1()
{
await Task.Yield();
diff --git a/src/tests/async/mincallcost-microbench.cs b/src/tests/async/mincallcost-microbench.cs
index 122994d8061c..900aad4ba45b 100644
--- a/src/tests/async/mincallcost-microbench.cs
+++ b/src/tests/async/mincallcost-microbench.cs
@@ -24,6 +24,7 @@ public static int Main()
return 100;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
public static async Task AsyncEntry()
{
if (!GCSettings.IsServerGC)
@@ -66,6 +67,7 @@ public static async Task AsyncEntry()
static double time = 10.0;
static bool printResult = false;
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task RunBench(string type)
{
if (printResult)
@@ -85,6 +87,7 @@ private static async Task RunBench(string type)
Console.WriteLine("Result = {0}", (long)avg);
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task Run(string type)
{
if (type == "AsyncCallingAsync")
@@ -114,6 +117,7 @@ private static async Task Run(string type)
}
#pragma warning disable CS1998
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task AsyncCallingAsync()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -131,6 +135,7 @@ private static async Task AsyncCallingAsync()
return numIters * 10;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task AsyncCallingValueTaskAsync()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -148,6 +153,7 @@ private static async Task AsyncCallingValueTaskAsync()
return numIters * 10;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task AsyncCallingAsync2()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -165,7 +171,7 @@ private static async Task AsyncCallingAsync2()
return numIters * 10;
}
- private static async2 Task Async2CallingAsync()
+ private static async Task Async2CallingAsync()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -182,7 +188,7 @@ private static async2 Task Async2CallingAsync()
return numIters * 10;
}
- private static async2 Task Async2CallingValueTaskAsync()
+ private static async Task Async2CallingValueTaskAsync()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -199,7 +205,7 @@ private static async2 Task Async2CallingValueTaskAsync()
return numIters * 10;
}
- private static async2 Task Async2CallingAsync2()
+ private static async Task Async2CallingAsync2()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -216,7 +222,7 @@ private static async2 Task Async2CallingAsync2()
return numIters * 10;
}
- private static async2 Task Async2CallingAsync2NoInlining()
+ private static async Task Async2CallingAsync2NoInlining()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -233,7 +239,7 @@ private static async2 Task Async2CallingAsync2NoInlining()
return numIters * 10;
}
- private static async2 Task Async2CallingAsync2WithContextSave()
+ private static async Task Async2CallingAsync2WithContextSave()
{
FakeThread thread = CurrentThread;
if (thread == null)
@@ -274,6 +280,7 @@ public class FakeThread
public static FakeThread CurrentThread;
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task AsyncCallingYield()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -291,7 +298,7 @@ private static async Task AsyncCallingYield()
return numIters * 10;
}
- private static async2 Task Async2CallingYield()
+ private static async Task Async2CallingYield()
{
Stopwatch timer = Stopwatch.StartNew();
@@ -325,6 +332,7 @@ private static long Sync2CallingSync()
return numIters * 10;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task EmptyAsync()
{
// Add some work that forces the method to be a real async method
@@ -333,6 +341,7 @@ private static async Task EmptyAsync()
return;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async ValueTask EmptyValueTaskAsync()
{
// Add some work that forces the method to be a real async method
@@ -341,7 +350,7 @@ private static async ValueTask EmptyValueTaskAsync()
return;
}
- private static async2 Task EmptyAsync2()
+ private static async Task EmptyAsync2()
{
// Add some work that forces the method to be a real async method
if (time == 0)
@@ -350,7 +359,7 @@ private static async2 Task EmptyAsync2()
}
[MethodImpl(MethodImplOptions.NoInlining)]
- private static async2 Task EmptyAsync2NoInlining()
+ private static async Task EmptyAsync2NoInlining()
{
// Add some work that forces the method to be a real async method
if (time == 0)
@@ -358,8 +367,8 @@ private static async2 Task EmptyAsync2NoInlining()
return;
}
- // This simulates async2 capturing the same amount of state that existing async needs to capture to handle the current semantics around async locals and synchronizationcontext
- private static async2 Task EmptyAsync2WithContextSave()
+ // This simulates async capturing the same amount of state that existing async needs to capture to handle the current semantics around async locals and synchronizationcontext
+ private static async Task EmptyAsync2WithContextSave()
{
FakeThread thread = CurrentThread;
FakeExecContext? previousExecutionCtx = thread._execContext;
diff --git a/src/tests/async/object.cs b/src/tests/async/object.cs
index fb62588652ae..f0173da2bded 100644
--- a/src/tests/async/object.cs
+++ b/src/tests/async/object.cs
@@ -14,13 +14,14 @@ public static int TestEntryPoint()
return (int)AsyncTestEntryPoint(100).Result;
}
+ [System.Runtime.CompilerServices.RuntimeAsyncMethodGeneration(false)]
private static async Task