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

[generator] Mark abstract methods as [Obsolete] if needed. - #1011

Merged
jonpryor merged 1 commit into
mainfrom
obsolete-abstract-methods
Jul 14, 2022
Merged

[generator] Mark abstract methods as [Obsolete] if needed.#1011
jonpryor merged 1 commit into
mainfrom
obsolete-abstract-methods

Conversation

@jpobst

@jpobstjpobst commented Jul 14, 2022

Copy link
Copy Markdown
Contributor

Fixes: #969

If you have a Java abstract method which is deprecated:

publicabstractclassExample {
@Deprecatedpublicabstractvoidm();
}

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

// BindingpublicabstractpartialclassExample:Java.Lang.Object{[Register()]publicabstractvoidM();}internalpartialclassExampleInvoker:Example{[Obsolete]publicoverridevoidM()=>}

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 mainJul 14, 2022
@jonpryor
jonpryor deleted the obsolete-abstract-methods branch July 14, 2022 17:55
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Apr 12, 2024
Sign up for freeto 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

2 participants

@jpobst@jonpryor