Steps to replicate:
- Define a generic type function that returns a type such as "Z8"
- Use that generic type as the type of an argument to another function.
Example: https://gerrit.wikimedia.org/r/c/mediawiki/services/function-orchestrator/+/822057
What happens:
Error during evaluation "Could not dereference Z7K1". However by adding more logging (see https://phabricator.wikimedia.org/T314927) I see that the underlying issue is: 'Generic type function did not return a Z4: {"Z1K1":"Z9","Z9K1":"Z8"}'
What should have happened instead:
'{"Z1K1":"Z9","Z9K1":"Z8"}' is a reference that just needs to be recursively evaluated to a 'Z4'
Here is the culprit: https://github.com/wikimedia/mediawiki-services-function-orchestrator/blob/1c3ae6ee52209e7952747c1dcae5dfb27ff1843a/src/ZWrapper.js#L130. The resolve() call here does not resolve references.