Describe the bug
When a protected binary contains a virtualized parameterless constructor, OldRod cannot infer the declaring type, and makes it static. This results in the recompiler failing as well since the this parameter does not exist, resulting in an IndexOutOfRangeException.
To Reproduce
Sample code that triggers the error:
using System;
namespace MyProgram
{
public class MyClass
{
public int X;
public MyClass()
{
X = 1234;
}
}
public static class Program
{
public static void Main(string[] args)
{
var x = new MyClass();
Console.WriteLine(x.X);
}
}
}
Expected behavior
A proper declaring type inference + proper recompilation.
Describe the bug When a protected binary contains a virtualized parameterless constructor, OldRod cannot infer the declaring type, and makes it static. This results in the recompiler failing as well since the this parameter does not exist, resulting in an IndexOutOfRangeException.
To Reproduce Sample code that triggers the error:
Expected behavior A proper declaring type inference + proper recompilation.
Additional context Related to #17