Created
October 26, 2010 11:49
-
-
Save rojepp/646766 to your computer and use it in GitHub Desktop.
Show how delegate definition matters, the following sample will rightfully not compile
This file contains hidden or 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
class Program | |
{ | |
delegate bool delA(string item); | |
delegate bool delB(string item); | |
static void Main(string[] args) | |
{ | |
delA del = s => true; | |
callA(del); | |
callB(del); | |
} | |
static void callA(delA a) | |
{ | |
} | |
static void callB(delB b) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment