Table of Contents

Struct UnionCaseDataModel

Namespace
PolyType.Roslyn
Assembly
PolyType.Roslyn.dll

Describes a creation member of a C# union.

public readonly struct UnionCaseDataModel
Inherited Members

Properties

CreationMember

Gets the specific constructor or interface factory that creates this case.

public required IMethodSymbol CreationMember { get; init; }

Property Value

IMethodSymbol

DeclaredType

Gets the case type in the context of the union's original definition.

public required ITypeSymbol DeclaredType { get; init; }

Property Value

ITypeSymbol

IsNullable

Gets whether the creation parameter's nullable contract accepts null.

public required bool IsNullable { get; init; }

Property Value

bool

TryGetValueMethod

Gets the public instance bool TryGetValue(out TCase) overload, when available.

public IMethodSymbol? TryGetValueMethod { get; init; }

Property Value

IMethodSymbol

Type

Gets the case type after substituting the union's type arguments.

public required ITypeSymbol Type { get; init; }

Property Value

ITypeSymbol