-
Notifications
You must be signed in to change notification settings - Fork 4k
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
System.IndexOutOfRangeException when binding #43223
Comments
This actually looks like a compiler problem, not an analyzer problem. Can you share the test that is hitting this? |
@333fred Sorry for the mixup. The analyzer does the following:
The codefix:
|
Is it something that you'd be able to share privately? Looking at your stack trace is telling me that whatever syntax you're testing on is actually running into this issue. I'd guess it's not a problem with the analyzer, just the literal text you're calling VerifyAnalyzerDiagnostics on. |
@333fred , I boiled it down a bit and removed everything in this repo.
after codefix
after running the codefix it crashes when rerunning the analyzer on the output, but I also have a testcase that runs the analyzer on the output as I show it above, and that functions fine. In the repo: method call that fails |
Analyzer package
Microsoft.CodeAnalysis.CSharp
Package Version
3.5.0
Repro steps
I have an analyzer project with multiple analyzers and codefixes. Up untill now the Test helpers generated when creating the project worked fine. With the latest codefix I created however, some error from deep down get's thrown up:
Stack trace:
I don't know what is going wrong. I've created a test which takes the outcome of the codefix generated in the above test that fails, and runs the Analyzer on that one, that one succeeds without any problem. Running the codefix in an experimental instance of Visual Studio also seems to work fine.
Expected behavior
CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync()
returnsn
diagnostics and does not throw an exception.Actual behavior
CompilationWithAnalyzers.GetAnalyzerDiagnosticsAsync()
throws an exception ofIndexOutOfRangeException
The text was updated successfully, but these errors were encountered: