Skip to content

Commit

Permalink
Correcting method AsyncMode determination to use AsyncTask if that be…
Browse files Browse the repository at this point in the history
…gan on the GeneratedMethod. Bumps to 3.1.1
  • Loading branch information
jeremydmiller committed Sep 25, 2023
1 parent 8f9b866 commit f0752fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<VersionPrefix>3.1.0</VersionPrefix>
<VersionPrefix>3.1.1</VersionPrefix>
<LangVersion>10.0</LangVersion>
<Authors>Jeremy D. Miller;Babu Annamalai;Oskar Dudycz;Joona-Pekka Kokko</Authors>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
Expand Down
8 changes: 8 additions & 0 deletions src/JasperFx.CodeGeneration/GeneratedMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ public void ArrangeFrames(GeneratedType type, IServiceVariableSource? services)

services?.StartNewMethod();

var startingAsyncMode = _asyncMode;

var compiler = new MethodFrameArranger(this, type, services);
try
{
Expand All @@ -216,6 +218,12 @@ public void ArrangeFrames(GeneratedType type, IServiceVariableSource? services)
e.Type = type;
throw;
}

// Correct the async mode even someone tried to override this
if (startingAsyncMode == AsyncMode.AsyncTask)
{
_asyncMode = startingAsyncMode;
}
}

public string ToExitStatement()
Expand Down

0 comments on commit f0752fd

Please sign in to comment.