lambda 传递ref参数有个语法bug,必须要显式书写参数类型。

//
delegate bool FuncType(ref int num);

FuncType func1;
func1 = num => true; //
func1 = (ref num) => true;//
func1 = (ref int num) => true;//ok

//并且,当一个参数书写类型,其他参数也要书写,总之很烦。

相关文章: