Reflexil
Reflexil copied to clipboard
Renaming class with inherited classes do not rename name of inherited from
Lets say we have
namespace a {
public class a : object {}
public class b : a {}
}
and use Reflxil rename (running from ILSpy) to change a.a
into ns_a.class_a
,
PEVerify fails on a.b
because inherit on name was not changed and is still left as a
I believe this happens even if namespace stays the same, but wanted to cover the namespace change case as well.
It works perfectly on my side. Can you give me a real repro ? with an assembly and your repro steps.
What version of ILSpy/Reflexil are you using?
Sorry for delayed response, this is for a hobby project so working on it when times allow. Running ILSpy version 2.3.1.1855 Reflexil v2.1
Full reproducable codesample: (codestyle to reduce lines in issue)
namespace a.a
{
public class a : object {
public a() { }
public int testAccess() { return 42; }
}
public class b : a {
public b() { }
public int a() { return 0; }
}
public class testAccessor {
public static int testAccess = new b().testAccess();
}
}
This is compiled as an .NET 2.0 Dll
And then trying to rename class a
and running verify results in (translated from localized message..) "unable to match token: a.a.testAccessor::cctor"
b
still inherits from a
and not from what a
was renamed to.
Reproduced. But not always.... Sometimes it works.
If you select b then go to a to rename it, it will fail. If you run ILSpy, go to a to rename it, it will work.
Perhaps a cache issue, investigating.
Same behaviour with Reflector
Ah, interesting, thanks for investigating, at-least now I know how it hopefully might be avoided, but I know it would be easier to debug/fix if there was a more consistent behavior.