I get CS0618 (obsolete member) warnings when some of the interface members are marked as [Obsolete].
Example
using System;
public interface ITest
{
[Obsolete]
void DoStuff1();
void DoStuff2();
}
public class MyTest : ITest
{
[Obsolete]
public void DoStuff1() => Console.WriteLine("Do stuff 1");
public void DoStuff2() => Console.WriteLine("Do stuff 2");
}
public class TestWrapper : ITest
{
[BeaKona.AutoInterface(typeof(ITest))]
private readonly ITest _test;
public TestWrapper(ITest test)
{
_test = test;
}
}
Now I get warnings for the implemented obsolete function DoStuff1.
Expected outcome
The Obsolete attribute (with all its parameters) should be copied to the generated DoStuff1 function, which would avoid the compiler warning.
Workaround
Currently, I implement the obsolete function myself and add the Obsolete attribute to ensure that DoStuff1 doesn't get generated and thus doesn't cause build warnings.
there is an issue #18 which was resolved last month. Currently, the working library is only available as a prerelease (1.0.30 and later).. The latest version is 1.0.35-pre.
Hi,
I get CS0618 (obsolete member) warnings when some of the interface members are marked as
[Obsolete]
.Example
Now I get warnings for the implemented obsolete function
DoStuff1
.Expected outcome
The
Obsolete
attribute (with all its parameters) should be copied to the generatedDoStuff1
function, which would avoid the compiler warning.Workaround
Currently, I implement the obsolete function myself and add the
Obsolete
attribute to ensure thatDoStuff1
doesn't get generated and thus doesn't cause build warnings.