A polyvariant subset problem

Hey. I encountered a problem related to polymorphic variants.

Is it possible to make this code compile while typing the array explicitly:

I need that array to be explicitly typed because in real life those items are passed to an external function that only accepts items of type a

Any help would be appreciated.

Here you go

Added clarification: it requires a hint to compiler that a type of passed item is a subtype of expected both type in the form of item :> both

1 Like

Nice! Thanks a lot. I didn’t even know about that syntax :smiley:

1 Like