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 (show other bugs)
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)

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


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

Note You need to log in before you can comment on or make changes to this bug.