While it is possible to create types dynamically i...
# puppet
h
While it is possible to create types dynamically in logic being evaluated (e.g returned by a function), there is no way to do this statically except by adding that type to the type system itself. The types used in signatures must all be static. The needed feature to make it work statically would be to allow typedefs to take arguments. I worked on a proposal for that but never finished as it is a bit of a pandora’s box. Something like this:
type OneOrMore[$T] = Variant[$T, Array[$T,1]]