Table of Contents

Class SourceGenTypeShapeProvider

Namespace
PolyType.SourceGenModel
Assembly
PolyType.dll

Defines a source generated ITypeShapeProvider implementation.

public abstract class SourceGenTypeShapeProvider : ITypeShapeProvider
Inheritance
SourceGenTypeShapeProvider
Implements
Inherited Members
Extension Methods

Properties

SourceGeneratorVersion

Gets the informational version of the source generator that created this provider.

public string? SourceGeneratorVersion { get; init; }

Property Value

string

Remarks

A null value typically identifies legacy generated output.

Methods

GetTypeShape(Type)

Gets a ITypeShape instance corresponding to the supplied type.

public abstract ITypeShape? GetTypeShape(Type type)

Parameters

type Type

The type for which a shape is requested.

Returns

ITypeShape

A ITypeShape instance corresponding to the current type.

IsLegacyShapeContextual(ITypeShape)

Infers contextual status for shapes created by legacy generated output.

protected virtual bool IsLegacyShapeContextual(ITypeShape shape)

Parameters

shape ITypeShape

The shape whose contextual status is being resolved.

Returns

bool

Whether the shape differs from the legacy provider's ordinary representation.