Читати англійською

Поділитися через


DeconstructionInfo Struct

Definition

The representation of a deconstruction as a tree of Deconstruct methods and conversions. Methods only appear in non-terminal nodes. All terminal nodes have a Conversion.

Here's an example: A deconstruction like (int x1, (long x2, long x3)) = deconstructable1 with Deconstructable1.Deconstruct(out int y1, out Deconstructable2 y2) and Deconstructable2.Deconstruct(out int z1, out int z2) is represented as 5 DeconstructionInfo nodes.

The top-level node has a Method (Deconstructable1.Deconstruct), no Conversion, but has two Nested nodes. Its first nested node has no Method, but has a Conversion (Identity). Its second nested node has a Method (Deconstructable2.Deconstruct), no Conversion, and two Nested nodes. Those last two nested nodes have no Method, but each have a Conversion (ImplicitNumeric, from int to long).

C#
public struct DeconstructionInfo
C#
public readonly struct DeconstructionInfo
Inheritance
DeconstructionInfo

Properties

Conversion

The conversion for a terminal position in the deconstruction tree.

Method

The Deconstruct method (if any) for this non-terminal position in the deconstruction tree.

Nested

The children for this deconstruction node.

Applies to

Продукт Версії
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0