﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3021	Match switch optimization causes issues with guards	Per Östlund	Martin Sjölund	"Guards on cases in a match rely on the fact that the generated code is a for-switch. When a match is optimized into a switch this no longer works correctly, since the switch won't try another case if the guard is false. Example:
{{{
uniontype U
  record INT
    Integer value;
  end INT;

  record REAL
    Real value;
  end REAL;
end U;

function greaterThanZero
  input U u;
  output Boolean b;
algorithm
  b := match(u)
    case INT() guard(u.value > 0) then true;
    case REAL() guard(u.value > 0) then true;
    else false;
  end match;
end greaterThanZero;

function test
algorithm
  greaterThanZero(INT(-2));
end test;
}}}
This will simply fail, instead of returning false as expected."	defect	closed	high	1.9.4	MetaModelica	trunk	fixed		
