Ferrous API Reference

All Types / Ferrous.Unions

class NewtypeGenerator

public sealed class NewtypeGenerator : IIncrementalGenerator

Incremental Roslyn source generator that turns a [Newtype(typeof(T))] readonly partial struct into a zero-overhead strongly typed wrapper implementing IEquatable<T>, IComparable<T>, IParsable<T>, ISpanFormattable, [NoDefault], and a NativeAOT-safe System.Text.Json converter.

Constants

public const string InvalidNewtypeDiagnosticId = "FE0101"

Diagnostic ID reported when [Newtype] is misapplied.

Methods

public void Initialize(IncrementalGeneratorInitializationContext context)