Skip to content

Methods get copied when they shouldn't #69

@maca88

Description

@maca88

Example:

public class ArrayOfDelegates
{
    public void Test()
    {
        var array = new List<Action>()
        {
            () =>
            {
                Read();
            },
            () =>
            {
                Write();
            }
        };
    }

    public void Read()
    {
        SimpleFile.Read();
    }

    public void Write()
    {
        SimpleFile.Write("");
    }
}

Expected result
When transforming the class into a new type, the Read and Write method shall only be converted to async and not also copied.

public class ArrayOfDelegatesAsync
{
    public Task ReadAsync()
    {
        return SimpleFile.ReadAsync();
    }

    public Task WriteAsync()
    {
        return SimpleFile.WriteAsync("");
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions