icsharpcode/ILSpy

delegate addition not using +=

Open

#1755 aperta il 21 ott 2019

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)C# (3645 fork)batch import
C#DecompilerEnhancementHelp Wanted

Metriche repository

Star
 (25.162 star)
Metriche merge PR
 (Merge medio 15g 22h) (61 PR mergiate in 30 g)

Descrizione

Ver. tested: d2f72583 Tested with multiple csc compilers.

class C
{
    public delegate void Del_t();
    Del_t dels;
    public void fn()
    {
        dels += cb;
    }
    private void cb() {}
}

Expected: fn to decompile to src form. Actual:

public void fn()
{
    dels = (Del_t)Delegate.Combine(dels, new Del_t(cb));
}

I could have sworn this used to work. Have I been dreaming? Is it a regression?

Guida contributor