Skip to content

Incorrect decompilation of base constructor calls (named arguments) #950

@mmusu3

Description

@mmusu3

Only an issue with pre-Roslyn compiler, tested with VS2013. Using named arguments out original order causes local variables to be used before base constructor is called.

Test case:

class Class
{
    Class(bool arg1 = false, bool arg2 = false) { }
        
    internal Class()
        : this(arg2: true, arg1: true)
    {
    }
}

Output:

private class Class
{
    private Class(bool arg1 = false, bool arg2 = false)
    {
    }

    internal Class()
    {
        bool arg = true;
        this..ctor(true, arg);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions