﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1560	Erroneous MetaModelica error for match expression	Per Östlund	Per Östlund	"The following doesn't work when compiling with +g=MetaModelica:
{{{
package test
  function f
    input list<String> inStrs;
    output list<String> outStrs;
  algorithm
    outStrs := match(inStrs)
      local

      // This doesn't work:
      case (""this"" :: _) then {""this""};

      // This does work:
      case (""this"" :: _)
        equation
          s = {""this""};
        then
          s;

      else inStrs;
    end match;
  end f;

  constant list<String> str = f({""this"", ""isn't"", ""working!""});
end test;
}}}
The following error is generated:
{{{
[test.mo:6:5-11:14:writable] Error: Match expression has mismatched result types:
  list<String>
  String[1]
}}}
This pattern is used by Tpl.takeLineOrString, which makes it impossible to call that function (or any function that uses that function) from a mos-script. It's easy to work around by introducing an extra variable though."	defect	closed	normal				wontfix		Per Östlund Martin Sjölund
