Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 4.9.4
-
None
-
None
-
Puppet Developer Experience
-
1
-
PDE 2017-03-22, PDE 2017-04-05
-
Not Needed
-
small internal optimization
-
No Action
-
covered by unit tests
Description
The values returned from a data provider are type checked by the lookup framework. Currently, this means that if the function that is backing the provider has a declared return type, then the value will be checked twice. This needs to change so that the lookup framework relies on the type check performed by the function when it is known to always check its returned value.
We need a mechanism that checks if all dispatchers of a function are declared with a return type, and if so, checks that they are all assignable to the Puppet::LookupValue, or if it is a data_hash, to the type Hash[Puppet::LookupKey,Puppet::LookupValue]. If it isn't assignable, an error should be raised.