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

When using the new collection initializer [] no SA1010 should be raised. #3850

Closed
Willimaendu opened this issue May 29, 2024 · 6 comments
Closed

Comments

@Willimaendu
Copy link

When having the following code:

List<string> list = [];

A warning "SA1010 Opening square brackets should not be preceded by a space" will be triggered. This should not happen when using the new collection initializer [].

@bjornhellander
Copy link
Contributor

bjornhellander commented May 29, 2024

I am unable to reproduce this using the latest beta. Looks like you just need to upgrade.

@bjornhellander
Copy link
Contributor

Duplicate of #3687

@dciborow
Copy link

I have just upgraded to 1.2.0-beta.556 and see this is fixed.

With shift to .net8 picking up folks may be seeing this more but not be getting the latest package because of the beta tag.

@sharwell sharwell closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
@Willimaendu
Copy link
Author

Thanks, we upgraded to the newest package and now everything works!

@twojnarowski
Copy link
Contributor

I also stumbled upon this issue... Why there hasn't been a new release in 5 years and we have to use beta versions?

@mu88
Copy link

mu88 commented Sep 17, 2024

@sharwell can you answer @twojnarowski's question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants