Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly detect calls which are not virtual and avoid related virtual method checks #3133

Open
vitek-karas opened this issue Nov 24, 2022 · 0 comments

Comments

@vitek-karas
Copy link
Member

In some cases it's clear from the code that a call to a virtual method is actually not virtual. For example if the method implements an interface but there are no calls to the method through the interface. Similarly for static abstract methods where calling the base can never happen. Same situation happens if the implementation method is called through reflection.

In such cases it is correct to avoid treating the call as virtual and thus avoiding additional work and checks related to virtual calls. So for example warning IL2092 could be avoided.

NativeAOT has this behavior due to the nature of itss code generation algorithms, so there's a discrepancy between ILLink and NativeAOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant