using System;
using System.Diagnostics;
class Program
{
static void Main()
{
DelStruct s;
ClosedDel del = s.InstanceMethod;
var dmi = DiagnosticMethodInfo.Create(del);
Console.WriteLine(dmi is null);
}
delegate void ClosedDel();
struct DelStruct
{
public void InstanceMethod() { }
}
}
Expected result:
False
Actual result:
True
The problem is that code here may pass an unboxing thunk address to the stack trace logic, which the latter doesn't understand - stack trace data records only unboxed entrypoints.
It probably makes sense to normalize the entrypoints on this path to their unboxed form (the reflection-based lookup will understand both).
Reproduction (compile, publish, run):
Expected result:
Actual result:
The problem is that code here may pass an unboxing thunk address to the stack trace logic, which the latter doesn't understand - stack trace data records only unboxed entrypoints.
It probably makes sense to normalize the entrypoints on this path to their unboxed form (the reflection-based lookup will understand both).