mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Add string interpolation examples to cs/useless-assignment-to-local.
This commit is contained in:
@@ -474,3 +474,13 @@ public static class Using
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class StringInterpolation
|
||||
{
|
||||
void Pi()
|
||||
{
|
||||
float pi = 3.14159f; // GOOD
|
||||
const int align = 6; // GOOD
|
||||
Console.WriteLine($"Pi, {pi,align:F3}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user