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

Cannot generate protected method in sealed type with managedOverride set to override #1127

Open
jpobst opened this issue Jun 26, 2023 · 0 comments
Labels
bug Component does not function as intended generator Issues binding a Java library (generator, class-parse, etc.)

Comments

@jpobst
Copy link
Contributor

jpobst commented Jun 26, 2023

If you attempt to fix a protected method in a sealed type that is not getting automatically set to override by using 'managedOverride'='override', the method will emitted as private.

This is because we attempt to fixup protected void Foo () { ... } in a sealed type when it isn't an override because it is a warning in C#.

However, this fixup does not take managedOverride into account.

https://github.com/xamarin/java.interop/blob/main/tools/generator/Java.Interop.Tools.Generator.Transformation/SealedProtectedFixups.cs#L13-L14

We should see if the user has set managedOverride to override, and if so, do not change the method to private.

@jpobst jpobst added bug Component does not function as intended generator Issues binding a Java library (generator, class-parse, etc.) labels Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component does not function as intended generator Issues binding a Java library (generator, class-parse, etc.)
Projects
None yet
Development

No branches or pull requests

1 participant