﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2015	Illegal discrete var assignement in if clause doesn't give error message	Peter Aronsson	somebody	"The following model is illegal:

{{{
class IllegalDiscreteVarInIfClause
  Real x(start = 1.0, fixed = true);
  Boolean b;
equation
  der(x) = -time;
  if noEvent(x < 0.5) then
  b = true;
  else
  b = false;
  end if;
end IllegalDiscreteVarInIfClause;
}}}
Because of the following statement in the  modelica language specification: 
''Inside an if-expression, if-clause or for-clause, that is controlled by a non-discrete time switching expression
and not in the body of a when-clause, it is not legal to have assignments to discrete variables, equations between
discrete-time expressions, or real elementary relations/functions that should generate events. [This restriction is
necessary in order to guarantee that there all equations for discrete variable are discrete-time expressions, and to
ensure that crossing functions do not become active between events.] '' (Version 3.3 page 32.

This does not produce an error message in OpenModelica 1.9.0 beta2
"	defect	closed	high	1.12.0	Frontend	1.9.0Beta	invalid		
