Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • D dezyne-issues
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Create a new issue
  • Jobs
  • Issue Boards
Collapse sidebar
  • dezyne
  • dezyne-issues
  • Issues
  • #67
Closed
Open
Issue created Jan 25, 2022 by Michael van de Ven@MikeFTR

Feature request: also support function to return with action used in a return expression to omit temporary variables

To further make the 'omit explicit temporary variables' feature complete, please allow support for returning an action output as return expression.

Two preferred flavours:

Result MyFunc()
{
   return rp.DoSomething(); // return the valued reply of a call on a required port
}

Result Calc()
{
    return MyFunc(); // return the return value of an other function
}

At this moment, when trying to write it this way, you'll get the following response on dzn verify: error: action used in a return expression

As a consequence the developer has to write it still with temporary variables, which is not nice-ish:

Result MyFunc()
{
   Result temp = rp.DoSomething(); // temporarily store the valued reply of a call on a required port
   return temp;
}

Result Calc()
{
   Result temp = MyFunc(); // temporarily store the valued reply of an other function
   return temp;
}
Edited Jan 25, 2022 by Michael van de Ven
Assignee
Assign to
Time tracking