﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4754	Tuple-returning calls are mistyped in if-equations	Per Östlund	Martin Sjölund	"This script:
{{{#!mo
setCommandLineOptions(""-g=MetaModelica"");
loadString(""
  function f
    input Integer i;
    output Real x;
    output Real y;
  algorithm
    x := i * 2;
    y := i * 3;
  end f;

  function test
    input Integer i;
    output Real x;
    output Real y;
  algorithm
    (x, y) := if i > 0 then f(1) else f(2);
  end test;
"");
test(1);
getErrorString();
}}}
gives the error message:
{{{
Error: Invalid pattern: (x, y) of type Real
Error: Tuple assignment only allowed when rhs is function call (in if i > 0 then (2.0, 3.0)[1] else (4.0, 6.0)[1]).
}}}
The second error is only printed due to a matchcontinue, but it does show that the compiler has decided to only use the first element of the tuples for some reason. If the if-expression is changed to something like {{{if i > 0 then (2.0, 3.0) else (4.0, 6.0);}}} then it works fine."	defect	closed	high		MetaModelica	v1.13.0-dev-nightly	invalid		
