Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Mark abstract methods as [Obsolete] if needed (#1011)
Fixes: #969 If you have a Java `abstract` method which is deprecated: // Java 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 { // Note: *not* [Obsolete] [Register (…)] public abstract void M(); } internal partial class ExampleInvoker : Example { [Obsolete] public override void M() => … } This state of affairs results in a [CS0809 warning][0]: warning CS0809: Obsolete member 'ExampleInvoker.M()' overrides non-obsolete member 'Example.M()' Commit 37cff25 added a fix for this for `JavaInterop1` output, asking: > TODO: should this change be done for *all* codegen targets? The answer: Yes. Expand the fix from 37cff25 to apply to `XAJavaInterop1` codegen, and add unit tests for this scenario. [0]: https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0809
- Loading branch information