Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

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

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?

Activity

  1. added
    enhancementProposed change to current functionality
    generatorIssues binding a Java library (generator, class-parse, etc.)
    on May 2, 2022
  2. added this to the 7.0.0 milestone on May 12, 2022
  3. removed their assignment
    on May 12, 2022
  4. locked and limited conversation to collaborators on Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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