Open martin-strecker-sonarsource opened 11 months ago
I can see two pull requests have been merged with master, does that mean this issue is fixed now?
We fixed the failure, so the end step is no longer failing. We did so by skipping symbols that overlapped. We keep this ticket open because the root cause still needs to be fixed.
This has been fixed in Roslyn 4.9.2 that was released last week
Ah, probably not yet. While the reference is present, it probably doesn't have the correct offset. @martin-strecker-sonarsource can you try to check?
See #8890 and changes in SymbolReferenceAnalyzerTest
Yes. The behavior we see in SymbolReferenceAnalyzerTest
is the overlapping bug. It is under test in the .Net 8 UTs and with the upgrade of Roslyn it is trickling down to the "normal" UTs as well. The comment in the UT describes the wrong behavior we expect to see with the upgrade (we see the (wrong) 6-23 reference that overlaps with it's declaration 0-17):
https://github.com/SonarSource/sonar-dotnet/blob/db66eb7d1e58ec79390decd4d4a500874f9840e5/analyzers/tests/SonarAnalyzer.Test/Rules/Utilities/SymbolReferenceAnalyzerTest.cs#L241-L246
I reported the problem in https://github.com/dotnet/razor/issues/10087
Based on this community report.
Description
The symbol reference for
@typeparam
symbols are miss-placed when compiled with the .Net8 SDK.Repro steps
.Net 8 BlazorWebAssembly
With
TestComponent.razor
Run the SonarAnalyzsis and generate the
.sonarqube\out\0\output-cs\symrefs.pb
file, like e.g. this one: symrefs.zipExpected behavior
The declaration range should be 12-29 and the reference range should be 36-53.
Actual behavior
The declaration range is 0-17 and the reference range is 6-23 and overlaps.
Known workarounds
Use .Net 7 SDK (no Symbol references are created). or add spaces between
where
and the type parameter reference: