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

SA0102 occurs when initializing array property #86

Open
MagnusMikkelsen opened this issue Nov 22, 2016 · 0 comments
Open

SA0102 occurs when initializing array property #86

MagnusMikkelsen opened this issue Nov 22, 2016 · 0 comments

Comments

@MagnusMikkelsen
Copy link

MagnusMikkelsen commented Nov 22, 2016

When running StyleCop on a file that has a property with a array, that gets initialized:

public int[] MyProperty { get; set; } = { 0 };

The SA0102 error is generated

SA0102 : CSharp.CsParser : A syntax error has been discovered in file <...snip...>

This seems to be due to the initializer portion of the property:

Because if you remove = { 0 }; the error no longer occurs.

Visual StyleCop Version 4.57.59.0

@MagnusMikkelsen MagnusMikkelsen changed the title SA0105 occurs when initializing array property SA0102 occurs when initializing array property Nov 22, 2016
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