You cannot pass a general argument as a variant of an open array . Support for native speakers is simply not suitable for this.
What you can do is wrap the general argument into a variant type. For example TValue . Now you cannot pass instances of TValue as parameters to the open array variant, but you can modify NotifyAll to accept the open TValue array TValue .
procedure NotifyAll(const AParams: array of TValue);
Once you do this, you can call it from your general method as follows:
NotifyAll([TValue.From<T>(AUser)]);
Basically, you are trying to do this; it is a combination of generics parameters with the variance of the runtime parameter. There are various options for the latter. Variant open array options are one of those options, but they don't mix well with generics. The alternative that I offer here, TValue , has a good interaction with generics.
source share