Closed amoraller closed 11 months ago
As I understood the real cause of the problem, the ObsoleteAttribute has Inherited=false and a copy of that attribute should be added to the generated source so compiler would not generate warning. It seems the correct aproach would be to add an additional attribute PassthroughAttributes="Obsolete" (that is the list of attributes). In that case Obsolete would be forwarded by default, but anyone could change that behaviour for other attributes.
I don't have enough free time at the moment and will try to solve this and another issue by the end of this year.
I've made nuget prerelease package 1.0.30-pre that should fix this issue.
thanks. It work for me.
Nice source generator. Thanks.
If i want delegate implementation to interface with Obsolete methods, i have compilation warnings CS0618. https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0618?f1url=%3FappId%3Droslyn%26k%3Dk(CS0618)
For example, i want delegate Nlog.ILogger implmentation.
NLog source coge:
Generated code:
I think, we want nesting Obsolete attribute.