Skip to content

Tuples deconstructing support #1832

@greenozon

Description

@greenozon

ILSpy version 6.0.0.5410-alpha1

Continuing games with new features, mainly tuples deconstructing
https://docs.microsoft.com/en-us/dotnet/csharp/deconstruct

input test code

 public class TestDeconstructors
        {
            private int a1, a2, a3;
            public void Deconstruct(out int a1, out int a2, out int a3)
            {
                a1 = this.a1;
                a2 = this.a2;
                a3 = this.a3;
            }

            public void Test1(TestDeconstructors other)
            {
                (a1, a2, a3) = other;
            }
        }

ILSpy:

public class TestDeconstructors
{
	private int a1;

	private int a2;

	private int a3;

	public void Deconstruct(out int a1, out int a2, out int a3)
	{
		a1 = this.a1;
		a2 = this.a2;
		a3 = this.a3;
	}

	public void Test1(TestDeconstructors other)
	{
		other.Deconstruct(out int num, out int num2, out int num3);
		a1 = num;
		a2 = num2;
		a3 = num3;
	}
}

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions