Created
March 14, 2012 16:51
-
-
Save jsclayton/2037821 to your computer and use it in GitHub Desktop.
Interface default parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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