Makes ConditionalAttribute can make attributes and methods remove from compilation, work as #if #9202
Unanswered
Flithor
asked this question in
Language Ideas
Replies: 2 comments 12 replies
-
This attribute already exists. https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.conditionalattribute?view=net-9.0 I guess the only difference is you also want the method itself to be removed from compilation. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Why aren't conditional preprocessor directives sufficient here? They're not verbose. If anything, they're less verbose than this new attribute property you're suggesting. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It can make the conditional compilation code more concise, avoiding a lot of #if-endif blocks in code.
Can also prevent the implementation related to it from being compiled into the binary file.
Beta Was this translation helpful? Give feedback.
All reactions