Page MenuHomePhabricator

functions returning a Type don't work as expected
Open, In Progress, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • note that Z21176 fails

What should have happened instead?:

  • it should pass

Other information (browser name/version, screenshots, etc.):
@GrounderUK diagnoses this as "a reference to a type is not always interpreted as a type".

The same thing was happening at https://www.wikifunctions.org/view/en/Z10112, but switching it to return an Object instead of a Type avoided the problem.

This seems related to T363623

Event Timeline

Apparently the same issue is affecting https://www.wikifunctions.org/view/en/Z23516, although interestingly it works when called as part of a composition https://www.wikifunctions.org/view/en/Z23142

Apparently the same issue is affecting https://www.wikifunctions.org/view/en/Z23516, although interestingly it works when called as part of a composition https://www.wikifunctions.org/view/en/Z23142

“Sorry”, I fixed the failing composition with Z23551, a new implementation of type of object (Z16829), wrapping with Z801. The function now returns a Type object rather than a Z1 (Z4/Z9).

Jdforrester-WMF changed the task status from Open to In Progress.Jan 14 2026, 7:35 PM
Jdforrester-WMF assigned this task to cmassaro.
Jdforrester-WMF subscribed.

These appear to now be working. @99of9, can you confirm?

@GrounderUK has made them work by wrapping with https://www.wikifunctions.org/view/en/Z104, so the actual block to progress is resolved.

I don't truly understand "validation", and still wouldn't expect to need it. Is it by design that a returned type needs to be validated?

Ah, I see. I think we will be phasing that kind of validation out, so it is not (or will not be, in the near future) by design that a type would need to be validated.

Ah, I see. I think we will be phasing that kind of validation out, so it is not (or will not be, in the near future) by design that a type would need to be validated.

I think the “validation” is purely ceremonial. Z801 should work just as well, but we would need to wrap it for each type to “guarantee” that the echoed object resolves to the required type.

(There’s a similar challenge, I think, when returning a ZReference in a ZPair, when the pair is typed with Z9 rather than with the type of the referenced object. I think my workaround in Z30417 is holding up, however.)