C#: Output async keyword for async methods (and suppress AsyncStateMachine)

This commit is contained in:
Katy Coe
2020-08-14 03:33:41 +02:00
parent f08cfd573c
commit 99a7e2e8cb
2 changed files with 8 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
Copyright 2017-2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
Copyright 2020 Robert Xiao - https://robertxiao.ca
All rights reserved.
@@ -285,6 +285,10 @@ namespace Il2CppInspector.Reflection
if (Name == "op_Explicit")
modifiers.Append("explicit ");
// Async depends on a compiler-generated attribute
if (GetCustomAttributes("System.Runtime.CompilerServices.AsyncStateMachineAttribute").Any())
modifiers.Append("async ");
// Will include a trailing space
return modifiers.ToString();
}