Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated and Obsolete #if blocks are not shared and generated separately #1

Open
chamons opened this issue Nov 10, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@chamons
Copy link
Owner

chamons commented Nov 10, 2021

Both Deprecated and Obsolete generated the #if block like this:

#if __MACCATALYST__
        [Obsolete ("Starting with maccatalyst", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
        [Obsolete ("Starting with ios11.0", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif

However, if you have each, they don't share #if's

#if NET
        [UnsupportedOSPlatform ("maccatalyst")]
#if __MACCATALYST__
        [Obsolete ("Starting with maccatalyst", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#if IOS
        [Obsolete ("Starting with ios11.0", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else

We could improve this by changing ProcessObsolete and ProcessDeprecated to communicate which #ifs are needed and generate into the same #if.

There is a test with this issue tagged showing the current sub-ideal behavior that could be corrected as an example.

@chamons chamons added the enhancement New feature or request label Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant