Open sandboxFocus

Enum UnionKind

Authoring forms of a union of C# 15, reported by UnionKind.

Namespace: Metalama.Framework.Code.Types
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public enum UnionKind
Remarks

The distinction matters because the language checks the restrictions on the members of a union for Declaration only. An instance field, an automatic property and a field-like event are forbidden in a union declaration and are allowed in the attribute form.

Fields

Name Description
Attribute

The union is a class or a struct that carries the System.Runtime.CompilerServices.UnionAttribute attribute. A union read from a referenced assembly is reported as this form, because the compiled form of every union carries that attribute and does not record whether the source used the union keyword.

Declaration

The union is declared with the union keyword.

None

The type is not a union. The code model never reports this value, because IUnionFacet exists for a union only. It is the default value of the enumeration.

See Also