Skip to content

Conversation

@jpobst
Copy link
Contributor

@jpobst jpobst commented Jul 14, 2022

Fixes: #969

If you have a Java abstract method which is deprecated:

public abstract class Example {
    @Deprecated
    public abstract void m();
}

then the C# binding is not [Obsolete], and the *Invoker override is [Obsolete]:

// Binding
public abstract partial class Example : Java.Lang.Object {
    [Register ()]
    public abstract void M();
}

internal partial class ExampleInvoker : Example {
    [Obsolete]
    public override void M() =>}

This state of affairs results in a CS0809 warning:

Error CS0809: Obsolete member 'ExampleInvoker.M()' overrides non-obsolete member 'Example.M()'

Expand the fix from #968 to apply to XAJavaInterop1 code generation.

@jpobst jpobst marked this pull request as ready for review July 14, 2022 15:19
@jonpryor jonpryor merged commit fe60483 into main Jul 14, 2022
@jonpryor jonpryor deleted the obsolete-abstract-methods branch July 14, 2022 17:55
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bindings of abstract methods should be [Obsolete] if Java method is @Deprecated

3 participants