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

SA0001 : CoreParser when using c# 6 dictionary initializing #79

Open
miszu opened this issue Jul 28, 2016 · 0 comments
Open

SA0001 : CoreParser when using c# 6 dictionary initializing #79

miszu opened this issue Jul 28, 2016 · 0 comments

Comments

@miszu
Copy link

miszu commented Jul 28, 2016

Hello.

I've found a small issue when using c# 6 dictionary initializing:

Dictionary<string, Foo> dictionary = new Dictionary<string, Foo>
{
["key"] = new Foo {Field = 5}
}

When one makes a mistake of not adding a space before Field or after 5, stylecop gives SA0001 warning in the first line of a file and also ignores all other warnings, so I've just seen this one and none of the other 15 mistakes typically found by stylecop.

SA0001 : CoreParser : An exception occurred while parsing the file: System.FormatException, Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

I will try to take a look in a free moment, just wanted to let others know what's the reason of it.

Have a great day,
Miszu

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

No branches or pull requests

1 participant