Repro
Compiler and run on .NET 10:
M(1);
void M(int x)
{
Console.WriteLine(x);
M(x+1);
Console.WriteLine(x);
}
Actual result
Very long stacktrace with at Program.<<Main>$>g__M|0_0(Int32) repeated thousands of time
Expected result
The repeating part of the stacktrace is eliminated, like:
Stack overflow.
....
Repeated 24121 times:
--------------------------------
at Program.<<Main>$>g__M|0_0(Int32)
--------------------------------
at Program.<Main>$(System.String[])