Tim Pohlmann

Results 45 comments of Tim Pohlmann

We don't, because we don't know what the result will be assigned to: ``` var negative = -1; var positive = 5; while (condition) { positive = positive * negative;...

This requires the mentioned step from #7457 + extra logic for `FirstOrDefault`. Should be straight-forward after #7866

@mary-georgiou-sonarsource That's a Good catch. The engine needs to learn `unknown` and not `NotNull` here. This means it is still an FP because S2259 does not raise on `unknown`.

I increased the priority of this ticket. Maybe we can pick it up in a future hardening sprint.

I updated priority and effort and moved this back to the backlog.

This has been fixed in [10.12](https://github.com/SonarSource/sonar-dotnet/releases/tag/10.12.0.118525)

@pavel-mikula-sonarsource will this be easier now that LVA supports `FlowCapture` operations? This behavior has other unpleasant side-effects like unnecessary branching in `foreach` loops: ```csharp try { foreach (string element in...

Yes, we have unnecessary branching, because we lose information that we should persist.

@jaredpar Fascinating post! Out of curiosity, do you have an example with actual numbers where removing the cast changes the result?

Linking back to an internal support ticket for future reference: https://sonarsource.atlassian.net/browse/USER-261