Skip to content

Conversation

@pkulikov
Copy link
Contributor

@pkulikov pkulikov commented May 27, 2019

Supported by dotnet/samples#929
Contributes to #10741

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Overall, this looks great @pkulikov

I'll review again once we've discussed the possible additional sample.

For operands of the same [delegate](../keywords/delegate.md) type, the `-` operator returns a delegate instance that is calculated as follows:

- If both operands are non-null and the invocation list of the second operand is a proper contiguous sublist of the invocation list of the first operand, the result of the operation is a new invocation list that is obtained by removing the second operand's entries from the invocation list of the first operand. If the second operand's list matches multiple contiguous sublists in the first operand's list, only the right-most matching sublist is removed. If removal results in an empty list, the result is `null`.
- If the invocation list of the second operand is not a proper contiguous sublist of the invocation list of the first operand, the result of the operation is the first operand.
Copy link
Member

Choose a reason for hiding this comment

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

Related to my comments on dotnet/samples#929 This is the condition that often surprises developers. An example would help.

@BillWagner
Copy link
Member

closing and re-opening for a new build.

@BillWagner BillWagner closed this May 28, 2019
@BillWagner BillWagner reopened this May 28, 2019
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This LGTM @pkulikov

Thanks for continuing to do so much of the work on the C# language reference.

I'll :shipit: now.

@BillWagner BillWagner merged commit cd1ccd7 into dotnet:master May 28, 2019
@pkulikov pkulikov deleted the merge-and-revise-subtraction-operators branch May 28, 2019 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants