AsmResolver System.Enum IsValueType=true workaround. Fixes #211#212
AsmResolver System.Enum IsValueType=true workaround. Fixes #211#212ds5678 merged 3 commits intoBepInEx:masterfrom
Conversation
|
I would feel more comfortable if you made an extension method |
|
I think your suggestion should work generally , although I have a couple of questions: I do not think extension method can override a non-extension one? |
This would be true if both were methods, but the original is a property.
ITypeDescriptor |
|
@ds5678 again, I have no way to determine, which ones need to be changed, so I changed them all and hope I did not miss one or two. Can you have a look and give your opinion please? |
This is exactly what I wanted.
Do a text search for |
That's how I did this in the first place. Yet, it's easy to miss one in the list of several dozens. What I'm saying is that I'm happy with my verification, but it might make sense for someone else to verify as well, up to you. |
|
I assume you verified that it fixes your issues? |
Yes, I did. |
|
@ds5678 it seems that the fix in AsmResolver was released now. I do not have time to revert the changes and test the result in the immediate future, but I wanted to give the headups in case somone else would like to do that. May be it can be done as part of the dependency upgrade. |
|
@AndrewSav 1.5.1 is the last release before v2, so don't worry about it. |
BepInEx#212) * fixes BepInEx#211 * use extensoin method * add a comment (cherry picked from commit 51abbdd)
This is what you get when you ask a person completely unfamiliar with a complex codebase to submit a PR.
As discussed in #211 I've tested that the code generated for one particular method I was having problem is now fine. I have no slightest idea, if this
IsValueTypematters elsewhere. For, example when a value of this type is passed as a method parameter. I also do not know how to find or test relevant code paths.IMO, this change is unlikely to break anything already not broken, but this may be not a comprehensive fix. I briefly considered patching this at run-time in AsmResolver using reflections, but this is going to be complex because this is not a field you can change the value off, it actually checks the binary metadata when you call this property, so you would need to patch code not just data to make it work. My guess that we do not want that in Il2CppInterop.
Another workaround is to wrap AsmResolver types, but it looks it will require a whole lot of types to wrap to the point of being unfeasible.
If you can reasonably be sure, that we cover everything here, that's good, but if not, I would not know what else we need to patch.