|
|
|
[
Permlink
| « Hide
]
Vladimir Reshetnikov - 10 Jun 07 21:56
I would recommend to use the following approach:
It is possible my example was poorly chosen. Usually when I provide examples to you I try to create something as simple as possible that illustrates the problem.
There are always ways to work around a problem. Likewise there are always ways to get ReSharper to stop warning about something. This does not mean that ReSharper's warnings are always valid. Here is another version of the code. I think that it is the best way to write it. If you are saying I should write longer code just to get ReSharper to stop warning about ICloneable, I would have to disagree. using System; using System.Collections; namespace ConsoleApplication1 { public class MyClass { private readonly Hashtable ht; private readonly OperatingSystem os; public MyClass(Hashtable ht, OperatingSystem os) { this.ht=(Hashtable)ht.Clone(); this.os=(OperatingSystem)os.Clone(); } } } Right now, I do not know what to do with this request.
On suggesting parameter type, except code analysis, we do some simple heuristics. This example shows that they are not enough |
|||||||||||||||||||||||||||||||||||||||||||||||||