Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Action a = StaticFunction;
Before C# 11, you'd need to use a lambda expression to reuse a single delegate object:

```csharp
Action a = () = StaticFunction;
Action a = () => StaticFunction();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Action a = () => StaticFunction();
Action a = () => StaticFunction;

Close, I think it just needed the goes to operator, but not the parentheses on StaticFunction. Let's double check with @BillWagner

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either will work in this instance. That's because there is only one overload of StaticFunction. I'd prefer the version with the parentheses because it would work when there are more overloads.

```

## C# language specification
Expand Down