Skip to content

Commit

Permalink
Merge pull request #14 from plyoung/main
Browse files Browse the repository at this point in the history
Fixed warnings thrown when AOT enabled
  • Loading branch information
Atlinx authored May 12, 2024
2 parents 116a3d8 + 8e516d1 commit cf58e02
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions addons/GDTask/Internal/DiagnosticsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -43,7 +44,8 @@ internal static class DiagnosticsExtensions
{ typeof(GDTaskVoid), "GDTaskVoid" }
};

public static string CleanupAsyncStackTrace(this StackTrace stackTrace)
[RequiresUnreferencedCode("Calls System.Diagnostics.StackFrame.GetMethod()")]
public static string CleanupAsyncStackTrace(this StackTrace stackTrace)
{
if (stackTrace == null) return "";

Expand Down Expand Up @@ -120,15 +122,15 @@ public static string CleanupAsyncStackTrace(this StackTrace stackTrace)
return sb.ToString();
}


static bool IsAsync(MethodBase methodInfo)
{
var declareType = methodInfo.DeclaringType;
return typeof(IAsyncStateMachine).IsAssignableFrom(declareType);
}

// code from Ben.Demystifier/EnhancedStackTrace.Frame.cs
static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType)
// code from Ben.Demystifier/EnhancedStackTrace.Frame.cs
[RequiresUnreferencedCode("Calls System.Type.GetMethods()")]
static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType)
{
declaringType = method.DeclaringType;

Expand Down

0 comments on commit cf58e02

Please sign in to comment.