Skip to content

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

Closed
@jonpryor

Description

@jonpryor

Context: #968
Context: #968 (comment)

PR #968 "uncovered" that 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()'

PR #968 fixed this warning for CodeGenerationTarget.JavaInterop1.

Should this also be done for CodeGenerationTarget.XAJavaInterop1?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementProposed change to current functionalitygeneratorIssues binding a Java library (generator, class-parse, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions