c# - Optional parameters on delegates doesn't work properly -


this question has answer here:

why piece of code not compile?

delegate int xxx(bool x = true);  xxx test = f;  int f() {    return 4; } 

optional parameters use on calling side - not on single-method-interface implementation. example, should compile:

delegate void simpledelegate(bool x = true);  static void main() {     simpledelegate x = foo;     x(); // print "true" }  static void foo(bool y) {     console.writeline(y); } 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -