Ferrous API Reference

All Types / Ferrous.States

class TypestateAnalyzer

public sealed class TypestateAnalyzer : DiagnosticAnalyzer

Roslyn diagnostic analyzer that enforces linear typestate protocols declared with [Typestate] and [ConsumesSelf].

Constants

public const string DirectConstructionDiagnosticId = "FE0300"

Diagnostic ID reported when a non-initial [Typestate] type is constructed outside a state transition.

public const string MissingConsumesSelfDiagnosticId = "FE0301"

Diagnostic ID reported when a transition method between [Typestate] types omits [ConsumesSelf].

public const string DiscardedTransitionDiagnosticId = "FE0302"

Diagnostic ID reported when the resulting state of a [ConsumesSelf] transition is discarded.

public const string LeakedTypestateDiagnosticId = "FE0303"

Diagnostic ID reported when a non-terminal [Typestate] local falls out of scope without transitioning, being consumed, or being returned.

Properties

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics

Methods

public override void Initialize(AnalysisContext context)