title: Interface implementation with optional arguments
body: <p>Take this interface:</p>
  
  <pre><code>interface ILogger
  {
      void Store(string payload);
  }
  </code></pre>
  
  <p>And this class implementation of <code>ILogger</code>:</p>
  
  <pre><code>class Logger : ILogger
  {
      void Store(string payload, bool swallowException = true)
      {
          ...
      }
  }
  </code></pre>
  
  <p>I would anticipate the compiler would recognize <code>swallowException</code> as an optional argument, and thus satisfy the requirements of the interface. Instead, what happens is the compiler complains that <code>Logger</code> does not implement interface member <code>Store</code>.</p>
  
  <p>Another interesting thing I tried was implementing the interface explicitly, like so:</p>
  
  <pre><code>class Logger : ILogger
  {
      void ILogger.Store(string payload, bool swallowException = true)
      {
          ...
      }
  }
  </code></pre>
  
  <p>The compiler gives a warning "The default value specified for parameter 'swallowException' will have no effect because it applies to a member that is used in contexts that do not allow optional arguments." It seems to suggest optional arguments are somehow incompatible with explicit interface definitions, but why?</p>
  
  <p>I can work around the problem by overloading <code>Store</code> with two separate function definitions (the way of doing things before optional arguments existed). However I like optional arguments for their syntactic clarity and would prefer that this just worked the way I expect.</p>
  
  <p>I understand there's probably a reasonable (historical or otherwise) explanation for why this is the way it is, but I can't seem to figure it out.</p>