Please provide
- Operating system: Windows 11
- Visual Studio version: 17.9.2
- SonarLint plugin version: 8.0.0.92083
- Programming language you’re coding in: C#
- Is connected mode used: No
And a thorough description of the problem / question:
I have this code where the sonarlint falsely warns me about unreachable code. It says that messageIds.Count is always false
List<int> messageIds = new List<int>();
Handlers.FindAll(h => h.IsTrue).ForEach(h => messageIds.Add(h.MessageID));
if (messageIds.Count > 0) // <-- warned about this condition always being false
_otherValidList.AddRange(new DIM().GetMessages(messageIds));