Steps to replicate the issue (include links if applicable):
- Please see Z24094
- Note the failing implementation
- Click details
What happens?:
The Wikidata item reference appears to contain a Typed Map rather than the expected string.
What should have happened instead?:
The expected string should be returned and the test should pass.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
This is an artificial recreation of a problem that has since been fixed (or worked around).
Implementation Z23421 returns a (synthetic) Wikidata item reference object containing a String object. This is presumably valid and the implementation passes all the function’s test cases.
When the function was used in composition Z24043, the composition failed with a mysterious error.
Alternative implementations for the inner function were created, allowing the composition to succeed.
Further investigation revealed that the Python implementation of Z20041 would also fail if asked to return the string within the Wikidata item reference returned by Z23419 (although it, too, was passing all its test cases). This is because the object being returned was interpreted as a Typed Map rather than a String. This too was fixed (by returning the Z6K1).
Sandbox functions have been used to emulate the implementations as they were before being fixed.
- Sandbox JavaScript emulates Z23419, returning a synthesised Wikidata item reference object
- Sandbox composition emulates Z24041, with compositions calling either the emulated JavaScript function (Z24074) or the corrected function that it emulates (Z24041).
- Sandbox Python emulates Z20041. Called with a value returned from Sandbox JavaScript, it returns a Typed Map.
It seems improper that a String object should ever be interpreted as a Typed Map, particularly in a context that should allow only objects that can resolve to strings (or references).

