title: Declaring resolution to ambiguous constructor reference
body: <p>Consider the following class</p>
  
  <pre><code>    class Foo
      {
          public Foo(IBar bar=null)
          {                
          }
      }
  </code></pre>
  
  <p>I have a need to inject an alternate constructor to allow the IBar instance to be provided on demand rather than injected.</p>
  
  <pre><code>    class Foo
      {
          public Foo(IBar bar=null)
          {                
          }
  
          public Foo(Func&lt;IBar&gt; barFunc) : this((IBar)null)
          {                
          }
      }
  </code></pre>
  
  <p>However there is a bunch of code in several dependent projects like: </p>
  
  <pre><code>        Foo foo = new Foo(null);
  </code></pre>
  
  <p>This code won't compile anymore due to the ambiguous constructor reference.</p>
  
  <p>Obviously I could change the code to</p>
  
  <pre><code>        Foo foo = new Foo((IBar)null);
  </code></pre>
  
  <p>But this would require changes to a whole bunch of projects, and my goal is a transparent change. Is there some way to specify which constructor to call if ambiguous? Or a way to indicate to the compiler that barFunc cannot be null</p>
  
  <p>At the moment, I am looking at this but it feels .... dirty</p>
  
  <pre><code>    class Foo
      {
          public Foo(IBar bar=null)
          {
  
          }
  
          public Foo(Func&lt;IBar&gt; barFunc, bool notUsed) : this((IBar)null)
          {
  
          }
      }
  </code></pre>