You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The game defines a type (U), which has been thoroughly virtualised by IPA as expected.
I inherit the class (as C), override some method (M), and pass an instance of my class to a method within the game.
Said method is calling the (now virtualised) method M. I expect my method (C.M) be called; but it is calling the original one (U.M).
The reason is that the IL for virtual method calls and normal calls is different. For normal method calls, no lookup is performed, and it will always go straight for the original implementation. This kinda nullifies the virtualisation of methods, because overriding them doesn't really do anything.
The behaviour is similar as if the class wasn't virtual, and I were to override the method using new. A possible "fix" would be to change the IL to adjust all method calls to virtual calls; however doing so likely incurs a performance impact, if it is even possible at all.
The text was updated successfully, but these errors were encountered:
Simple scenario:
The reason is that the IL for virtual method calls and normal calls is different. For normal method calls, no lookup is performed, and it will always go straight for the original implementation. This kinda nullifies the virtualisation of methods, because overriding them doesn't really do anything.
The behaviour is similar as if the class wasn't virtual, and I were to override the method using
new
. A possible "fix" would be to change the IL to adjust all method calls to virtual calls; however doing so likely incurs a performance impact, if it is even possible at all.The text was updated successfully, but these errors were encountered: