The list of C# 6.0 final features contains a feature called #pragma listed as "Added" and the example is to disable warnings. However this feature did exist in C# before 6.0. What exactly was added in 6.0?
Previously, you had to specify the warning number. So to disable CS0501, you'd use
#pragma warning disable 0501
Now, you can use
#pragma warning disable CS0501
... which is incredibly important when you've got Roslyn Code Analyzers raising warnings with different identifiers. It's basically changed the namespace of warnings from "digits" to "alphanumeric strings".
I don't know the details of the new grammar - I haven't seen a C# 6 spec yet - but the old grammar was:
warning-list:
decimal-digits
warning-list whitespaceopt ,
whitespaceopt decimal-digits
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With