Skip to content

Fix class injector abstract method handling#134

Merged
ds5678 merged 2 commits intoBepInEx:masterfrom
WNP78:parameterinfo-fix
Sep 8, 2024
Merged

Fix class injector abstract method handling#134
ds5678 merged 2 commits intoBepInEx:masterfrom
WNP78:parameterinfo-fix

Conversation

@WNP78
Copy link
Copy Markdown
Contributor

@WNP78 WNP78 commented Jun 20, 2024

The class injector does checking on abstract methods to match parameter names and types of implemented methods, but the ParameterInfo struct and hence the name field was removed in newer versions of IL2CPP. This is an easy fix because the IL2CPP API has a method to get the name of a parameter from the MethodInfo and index.

…rsions where Il2CppParameterInfo doesn't exist.
Copy link
Copy Markdown
Collaborator

@ds5678 ds5678 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in favor of simply removing the parameter name check because it's not part of the method signature.

I also think we should add a check for the return type.

@Kasuromi thoughts?

@ds5678 ds5678 added this to the 1.4.6 milestone Jul 15, 2024
@Kasuromi
Copy link
Copy Markdown
Member

Using the method signature is better to solve this exact issue, though we need to also see about how we'll handle ParameterInfo not being present in newer il2cpp versions.

Either way, if we switch this to use everything that is part of the method signature this would be good for merging.

@ds5678 ds5678 merged commit 7a56995 into BepInEx:master Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants