Bug 36646 - Delegate.Remove for combined delegate works different from Microsoft .Net
Summary: Delegate.Remove for combined delegate works different from Microsoft .Net
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 4.2.0 (C6)
Hardware: PC All
: --- normal
Target Milestone: (C6SR1)
Assignee: Ludovic Henry
Depends on:
Reported: 2015-12-05 07:44 UTC by Igor Kiselev
Modified: 2016-01-28 19:25 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Igor Kiselev 2015-12-05 07:44:47 UTC
Delegate.Remove with 4.2 updates changed behavior for combined delegate. It may be even better than was before, but it differs from Microsoft .Net.

Test case:
using System;
public static class Program
    public static void Main(string[] args)
        Action a = A;
        Action b = B;
        Action c = C;
        Action s = a + b + c + Console.WriteLine;
        s();                  //ABC 
        (s - (a + c))();      //ABC 

    public static void A()

    public static void B()

    public static void C()

Expected result:

Actual result:

Not sure, if it really needs to be fixed.
Comment 1 Ludovic Henry 2015-12-07 01:32:17 UTC
That clearly seems like a bug on the .NET side. I will check tomorrow what is the behaviour on windows.
Comment 2 Igor Kiselev 2015-12-07 01:43:37 UTC
Here is some information about it: https://confluence.jetbrains.com/plugins/servlet/mobile#content/view/42337747
Comment 3 Ludovic Henry 2015-12-07 04:17:54 UTC
Ok, thank you for the additional information. I will check the behaviour and implementation on .NET, and will fix it ASAP.

Thank you for the report!
Comment 5 Arpit Jha 2015-12-15 07:05:01 UTC
I have checked this issue with latest mono master MonoFramework-MDK- and its working fine .

Now getting following expected output in console on implementing code mentioned in console project.


Screencast : http://www.screencast.com/t/V6cPcEjYWe

Full Environment Info: https://gist.github.com/Arpit360/7894b76414dafa05a21b

Hence closing this issue.
Comment 6 Arpit Jha 2016-01-15 05:23:12 UTC
I have checked this issue latest C6SR1 Mono and observed that on implementing attached code snippet in console App and getting expected output in console.

Screencast: http://www.screencast.com/t/PkSCwtf011
Environment Info: https://gist.github.com/Arpit360/2fd3b86736341972ac56