-
-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Description
Version of the Meziantou.Analyzer NuGet package
2.0.295
Rule Identifier
MA0185
Target Framework
net10.0
C# Language version
C# 14
Description
I'm getting false positive error
0>Program.cs(10,14): Error MA0185 : Simplify string.Create when all parameters are culture invariant (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0185.md)
Changing to int n (non-nullable) doesn't trigger the rule.
If I change to interpolated string, I'm getting a different warning
MA0076 - Do not use implicit culture-sensitive ToString in interpolated strings
Reproduction Steps
Minimal code:
class Program
{
static void Main(string[] args)
{
int? n = 42;
var s = string.Create(CultureInfo.InvariantCulture, $@"/v{n}");
Console.WriteLine(s);
}
}Other information
No response
Reactions are currently unavailable