Represents the structure of a union of C# 15: its authoring form, its cases and its Value property.
Namespace: Metalama.Framework.Code.Types
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
[InternalImplement]
public interface IUnionFacet : ITypeFacetRemarks
The facet is reached through Union, as in type.Facets.Union?.Cases. It is
null for a type that IsUnion reports as not being a union.
A union is not a kind of its own in the code model. The compiler reports a union declaration as a struct, and the attribute form keeps the kind of the class or the struct that carries the attribute, so IsUnion is the property that tells a union from an ordinary type and this facet is the structure behind it.
Properties
| Name | Description |
|---|---|
| Cases | Gets the cases of the union, in the order in which the creation members of the union declare them, which is the order of the union header for a union declaration. |
| UnionKind | Gets the authoring form of the union. |
| ValueProperty | Gets the |