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

LoopedRandomInstantion with structs #577

Closed
Vannevelj opened this issue May 10, 2016 · 1 comment
Closed

LoopedRandomInstantion with structs #577

Vannevelj opened this issue May 10, 2016 · 1 comment

Comments

@Vannevelj
Copy link
Owner

Right now it seems like we're not account for this to happen in a struct. Concerns this line at https://github.com/VSDiagnostics/VSDiagnostics/blob/develop/VSDiagnostics/VSDiagnostics/VSDiagnostics/Diagnostics/General/LoopedRandomInstantiation/LoopedRandomInstantiationAnalyzer.cs#L45:

while (!currentNode.IsKind(SyntaxKind.ClassDeclaration))
@Hosch250
Copy link
Contributor

Hosch250 commented May 11, 2016

The problem there is that it just will not early-exit for struct--it will keep climbing the tree right up to the compilation syntax and crash when the node is null. The crash actually will only occur when the Random instantiation is not in a loop because it returns as soon as it reports the diagnostic.

I can fix this one.

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

2 participants