| For anyone implementing this: it is important to know that when asking for a data type, all types that are not explicitly defined are by design a Resource datatype (yes, for historical reasons it needs to do this). Since the ask for a data type must use a string the logic ends up doing this:
# Find a resource type, definition or class definition |
Puppet::Pops::Evaluator::Runtime3ResourceSupport.find_resource_type_or_class(scope, val)
|
I think it may need to do that first, and if not found, then try the 4.x loaders to load the data type - i.e. something like this:
loader = Puppet.lookup(:loaders).private_environment_loader() |
type = loader.load(:type, type_name)
|
But, in Puppet 6 it may work to only use the 4.x loaders. |