Skip to content

Commit cf58e02

Browse files
authored
Merge pull request #14 from plyoung/main
Fixed warnings thrown when AOT enabled
2 parents 116a3d8 + 8e516d1 commit cf58e02

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

addons/GDTask/Internal/DiagnosticsExtensions.cs

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System;
33
using System.Collections.Generic;
44
using System.Diagnostics;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Globalization;
67
using System.IO;
78
using System.Linq;
@@ -43,7 +44,8 @@ internal static class DiagnosticsExtensions
4344
{ typeof(GDTaskVoid), "GDTaskVoid" }
4445
};
4546

46-
public static string CleanupAsyncStackTrace(this StackTrace stackTrace)
47+
[RequiresUnreferencedCode("Calls System.Diagnostics.StackFrame.GetMethod()")]
48+
public static string CleanupAsyncStackTrace(this StackTrace stackTrace)
4749
{
4850
if (stackTrace == null) return "";
4951

@@ -120,15 +122,15 @@ public static string CleanupAsyncStackTrace(this StackTrace stackTrace)
120122
return sb.ToString();
121123
}
122124

123-
124125
static bool IsAsync(MethodBase methodInfo)
125126
{
126127
var declareType = methodInfo.DeclaringType;
127128
return typeof(IAsyncStateMachine).IsAssignableFrom(declareType);
128129
}
129130

130-
// code from Ben.Demystifier/EnhancedStackTrace.Frame.cs
131-
static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType)
131+
// code from Ben.Demystifier/EnhancedStackTrace.Frame.cs
132+
[RequiresUnreferencedCode("Calls System.Type.GetMethods()")]
133+
static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType)
132134
{
133135
declaringType = method.DeclaringType;
134136

0 commit comments

Comments
 (0)