dotvariant icon indicating copy to clipboard operation
dotvariant copied to clipboard

Can not compile Nested Variant with Generics from Parent

Open Gallimathias opened this issue 2 years ago • 1 comments

I have following Pattern

[Variant]
public class Parent<TInput, TOutput, TValue, TExternalValue>
{
    static partial void VariantOf(
            Notification<string> notification,
            Parent<TInput, TOutput, TValue, TExternalValue>.ChildA a,
            Parent<TInput, TOutput, TValue, TExternalValue>.ChildB b
        );

    [Variant]
    public partial class ChildA
    {
        static partial void VariantOf(
            string name,
            TInput input,
            TExternalValue value
        );
    }

    [Variant]
    public partial class ChildB
    {
        static partial void VariantOf(
            TOutput output,
            TValue value,
            Action action
        );
    }
}

I get now a build issue that ChildAEx can not Build because it don't know about TExternalValue

Gallimathias avatar Aug 12 '22 13:08 Gallimathias

Nested variants are currently not supported, see #28. Biggest complication is correctly handling the visibility of generated code.

mknejp avatar Aug 12 '22 14:08 mknejp