mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-04-08 20:06:42 +00:00
csharp: add static lambda annotation notes
This commit is contained in:
parent
4d414e5f95
commit
5449280640
1 changed files with 3 additions and 0 deletions
|
@ -2142,6 +2142,9 @@ Delegate<Type> lambda = input => { return <expr>; };
|
||||||
Delegate<Type> lambda = (input) => { return <expr>; };
|
Delegate<Type> lambda = (input) => { return <expr>; };
|
||||||
Delegate<Type> lambda = (Type input) => { return <expr>; };
|
Delegate<Type> lambda = (Type input) => { return <expr>; };
|
||||||
|
|
||||||
|
// static modifier prevents unintentional capture of local variables or instance state by the lambda
|
||||||
|
Delegate<Type> lambda = (static Type input) => <expr>;
|
||||||
|
|
||||||
Type variable = delegate { <expression>; }; // ignore arguments of the method passed to the delegate
|
Type variable = delegate { <expression>; }; // ignore arguments of the method passed to the delegate
|
||||||
|
|
||||||
// lambda type inference [C# 10]
|
// lambda type inference [C# 10]
|
||||||
|
|
Loading…
Add table
Reference in a new issue