Skip to content

Naming conflict with primary constructor parameters #3616

@siegfriedpammer

Description

@siegfriedpammer

Oh I forgot to mention in the main post but I still had one unsolved issue that isn't part of #3611. It is a variable naming conflict. I had trouble creating a simple case that doesn't involve pattern matching so this will have to do. It only occurs once in my full decompiled code project so it's a low priority.

Input

private class C8(object obj)
{
    public int Test()
    {
        if (obj is int i)
            return i;
        return 0;
    }
}

Output

private class C8(object obj)
{
    public int Test()
    {
        object obj = obj; // Name conflict
        if (obj is int)
            return (int)obj;
        return 0;
    }
}

Originally posted by @mmusu3 in #3614 (comment)

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