dotvariant icon indicating copy to clipboard operation
dotvariant copied to clipboard

A type-safe and space-efficient sum type for C# (comparable to discriminated unions in C or C++)

Results 15 dotvariant issues
Sort by recently updated
recently updated
newest added

I have following Pattern ````csharp [Variant] public class Parent { static partial void VariantOf( Notification notification, Parent.ChildA a, Parent.ChildB b ); [Variant] public partial class ChildA { static partial void...

https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

Right now disposing is only handled for `IDisposable`. However if a type implements `IAsyncDisposable` the variant should implement that as well and delegate asynchronous disposing to the live value where...

enhancement

If `System.Collections.Generic.IAsyncEnumerable` exists generate extension methods similar to those for `IEnumerable`.

enhancement

Currently all generated extension methods are `public` regardless of the visibility of the variant type. Thus the following generates invalid code because the generated extensions have inconsistent accessibility: ```cs namespace...

bug

Currently the generated `static class` containing extension methods is either `public` or `internal` based on the visibility of the variant itself, but it doesn't take into consideration the visibility of...

bug

Currently all generated methods are `public` regardless of the visibility of the contained type. Thus the following generates invalid code because the generated members have inconsistent accessibility: ```cs internal class...

bug

If a variant `class` has no default constructor and all other constructors initialize the `_variant` field to a non-default value then the variant cannot be empty. Under these circumstances the...

enhancement

If the user already defines certain special methods (like `ToString` or `Equals`) don't generate them. This is currently only supported for `Dispose`. Candidates: - [ ] Constructors - [ ]...

enhancement

Right now variant classes are only supported at namespace-level. Attempting to create one as a nested class will generate invalid code.

enhancement