title: Passing ICollection as a argument
body: <p>I am stuck with this simple looking code for over an hour now...
  I have few classes...and methods like this:</p>
  
  <pre><code>abstract class ClassBase&lt;SampleInterface&gt; {//Some methods};
  
  public class ClassAction1: ClassBase&lt;MyInterface&gt; {//Some methods};
  
  public class ClassAction2: ClassBase&lt;MyInterface&gt; {//Some methods};
  
  class SomeClass
  { 
      public void AddClassRange(ICollection&lt;ClassBase&lt;MyInterface&gt;&gt; range)
      {
          foreach (ClassBase&lt;MyInterface&gt; ClassBase in range)
              AddClass(ClassBase);
      }
  
  
      public void AddClass(ClassBase&lt;MyInterface&gt; behavior)
      {
          // Something
      }
  }
  </code></pre>
  
  <p>Now, I am trying to use these codes in a different class:</p>
  
  <pre><code>var arg1 = new ClassAction1 {//Something};
  var arg2 = new ClassAction2 {//Something};
  
  //try1
  sampleElement.AddClassRange(new [] { arg1 });   // works fine
  
  //try2
  sampleElement.AddClassRange(new [] { arg2 });   // works fine
  </code></pre>
  
  <p>I want to combine try1 and try2:</p>
  
  <pre><code>// Something like this (try3)
  sampleElement.AddClassRange(new [] { arg1, arg2 });   // Error
  Error : No best type found for implicitly typed array
  </code></pre>
  
  <p>As I think, In try1 and try2 runtime is deciding the <code>type</code> for keyword <code>new</code> based on the parameter passed to it. But in try3, parameters are of different types and runtime fails to decide for the best <code>type</code> for the <code>new</code> keyword.</p>
  
  <p>Thanks. Let me know if need more info.</p>