C#: Recognize all overloads of String.Replace as a replace method.

This commit is contained in:
Michael Nebel
2024-01-03 11:08:05 +01:00
parent 0c4e1fca1b
commit 31e12f7a06

View File

@@ -346,11 +346,11 @@ class SystemStringClass extends StringType {
result.hasName("==")
}
/** Gets the `Replace(string/char, string/char)` method. */
/** Gets the `Replace(...)` method. */
Method getReplaceMethod() {
result.getDeclaringType() = this and
result.hasName("Replace") and
result.getNumberOfParameters() = 2 and
result.getNumberOfParameters() in [2 .. 4] and
result.getReturnType() instanceof StringType
}