title: C# 4.0: Can I use a TimeSpan as an optional parameter with a default value?
body: <p>Both of these generate an error saying they must be a compile-time constant:</p>
  
  <pre><code>void Foo(TimeSpan span = TimeSpan.FromSeconds(2.0))
  void Foo(TimeSpan span = new TimeSpan(2000))
  </code></pre>
  
  <p>First of all, can someone explain why these values can't be determined at compile time? And is there a way to specify a default value for an optional TimeSpan object?</p>