Skip to content

Instantly share code, notes, and snippets.

@jsclayton
Created March 14, 2012 16:51
Show Gist options
  • Save jsclayton/2037821 to your computer and use it in GitHub Desktop.
Save jsclayton/2037821 to your computer and use it in GitHub Desktop.
Interface default parameters
using System;
namespace Defaults
{
internal class Program
{
private static void Main(string[] args)
{
new Foo().Bar();
((IFoo) new Foo()).Bar();
}
}
internal interface IFoo
{
void Bar(bool test = true);
}
internal class Foo : IFoo
{
public void Bar(bool test = false)
{
Console.WriteLine(test);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment