-
Notifications
You must be signed in to change notification settings - Fork 33
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
[BUG] NUnit1018 doesn't recognize collection expression #726
Comments
Thanks for reporting. Object arrays didn't exist when this rule was written. My main concern is if I can add this without requiring NET 8.0 SDK or if we need different binaries depending on SDK. |
It seems |
Roslyn versions are not related to SDK versions. It is part of C#12. |
All I meant is that for you to handle the new collection expression syntax, you'll have to update |
Unfortunately it is not as simple. When we moved to version 3 we maintained two different versions of the analyzer. There are ways to support multiple SDKs one which I have done for another analyzer is to add an extra dll to the package for analyzers requiring later versions. Another way is to use private versions of the new types like StyleCop does. |
I read a bit about it. It's a pity it works like this. Makes life hard for those publishing analyzers if they want to keep up with the new syntax. |
In the following pseudo-code:
NUnit analyzer raises an error:
It seems it doesn't understand
[1,2,3]
as an object array.So one needs to avoid/supress IDE0300 suggestion for those cases.
The text was updated successfully, but these errors were encountered: