﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4502	Comparison fails for enumerations wrapped in uniontypes	Per Östlund	Martin Sjölund	"See the attached script, which simply wraps an enumeration in a uniontype and then tries to compare it. The expected output is:
{{{
f: E.one
f: E.two
f: E.three
}}}
The actual output if no extra flags are given is:
{{{
f: f:
}}}
The bigger issue though is that when code generation is forced on with '-d=noevalfunc,gen', representing what happens if you try to do something like this in the compiler, the output becomes:
{{{
f: E.two
f:
f:
}}}
If the function is rewritten to use a match instead:
{{{#!mo
function f
  input UT ut;
protected
  String s;
algorithm
  print(""f: "");
  s := match ut.e
    case E.one then ""E.one"";
    case E.two then ""E.two"";
    case E.three then ""E.three"";
  end match;
  print(s + ""\n"");
end f;
}}}
then it behaves correctly when code generation is forced on but still gives the same output when using interpretation."	defect	new	critical	Future	MetaModelica				
