Skip to content

Commit

Permalink
#12: Add special case for rewriting AsyncMethodBuilderCore
Browse files Browse the repository at this point in the history
  • Loading branch information
nikopede committed Dec 12, 2024
1 parent 27a85dc commit 14a253e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Pose/IL/MethodRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ private static bool ShouldForward(MethodBase member)
{
var declaringType = member.DeclaringType ?? throw new Exception($"Type {member.Name} does not have a {nameof(MethodBase.DeclaringType)}");

if (declaringType.Namespace == typeof(AsyncTaskMethodBuilder).Namespace && declaringType.Name == "AsyncMethodBuilderCore") return false;

// Don't attempt to rewrite inaccessible constructors in System.Private.CoreLib/mscorlib
if (!declaringType.IsPublic) return true;
if (!member.IsPublic && !member.IsFamily && !member.IsFamilyOrAssembly) return true;
Expand Down

0 comments on commit 14a253e

Please sign in to comment.