Skip to content

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

Open
@jpobst

Description

@jpobst

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugComponent does not function as intendedgeneratorIssues binding a Java library (generator, class-parse, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions