Page MenuHomePhabricator

A composition consisting of only an argument does not work
Open, HighPublic

Description

Assume I have a function "Is true" taking a Boolean and returning a Boolean (which returns whether the argument is true) - which is also the same as the function "Identity" for Boolean (see T286606) - it should be possible to offer the following implementation for that function:

{
    "Z1K1": "Z2",
    "Z2K1": "Z10011",
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z10008",
        "Z14K2": {
            "Z1K1": "Z18",
            "Z18K1": {
                "Z1K1": "Z6",
                "Z6K1": "Z10008K1"
            }
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Is true direct"
            }
        ]
    }
}

I.e. the core part is:

"Z14K2": {
    "Z1K1": "Z18",
    "Z18K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10008K1"
    }

i.e. the composition is just an argument reference to the single argument of the function.

But when I call the function with that implementation I receive the following result (independently of the argument):

{
    "Z1K1": "Z22",
    "Z22K1": "Z23"
}

Z22K1 should be the argument instead.

Event Timeline

DVrandecic triaged this task as Medium priority.Wed, Jul 21, 4:31 PM
DVrandecic raised the priority of this task from Medium to High.

Change 706021 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-orchestrator@master] Address case where implementation consists of only an argument.

https://gerrit.wikimedia.org/r/706021

Change 706023 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-schemata@master] Allow implementations to be Z18s in addition to Z7s.

https://gerrit.wikimedia.org/r/706023

Change 706023 merged by jenkins-bot:

[mediawiki/services/function-schemata@master] Z14/Implementation: Allow them to be individual Z18s as well as Z7s

https://gerrit.wikimedia.org/r/706023