stryker-net
                                
                                 stryker-net copied to clipboard
                                
                                    stryker-net copied to clipboard
                            
                            
                            
                        Use of unassigned local variable
Describe the bug I receive the warning "Stryker.NET encountered an compile error...with message: Use of unassigned local variable 'result'", and I'm asked to report this to GitHub. Please see the following repo for a minimum reproduction of the issue: https://github.com/nheath99/StrykerDemo It seems to occur whenever a variable is declared but not initialised, and then used later in the method.
Logs log-20220221.txt
Expected behavior I would not expect this exception to be thrown.
Desktop (please complete the following information):
- OS: Windows 11
- Type of project core
- Framework Version 6.0
- Stryker Version 1.3.1
Additional context Add any other context about the problem here.
I've seen code like
int x; if(a) { x = 1; } else { x = 2 } return x;
fail, but if x is explicitly initialized it does not fail i.e. int x = 0;
I'm also dealing with a project that generates many errors like the one described above. There are so many, that even 50 compilation retries are not enough to compile it successfully.
Note that you will get rid of this errors if you disable Block mutators!.
I can't seem to reproduce this issue anymore. Please reopen if another reproduction is found.