Regarding this issue, indeed the
string.Intern method does have the side-effect of adding the string value to the intern pool if it is not already there.
However, I fail to see what is the point of not using the returned value of the method: the string given as parameter will still reference the string value that was created on the heap (assuming it was not a value already in the intern pool); only the string reference returned by the method is ensured to point to the value inside the intern pool.
Do you have use case where it makes sense to not use the returned value of the
Otherwise, we will simply update the message for this method so that it does not mention side-effect, as I agree that the wording is wrong in that case.