﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4158	OMC does not detect illegal use of pre() in when clause conditions	Francesco Casella	somebody	"Consider the following test case:
{{{
model TestPre
  Real x;
  Boolean b(start = false, fixed = true);
equation
  der(x) = 1;
  when pre(x) > 0.5 then
    b = true;
  end when;
end TestPre;
}}}

The model is illegal, because {{{x}}} in the when clause condition is **not** a discrete-time expression (see Modelica 3.3v1, section 3.8.3), as it appears outside the **body** of a when clause.

OMC instead accepts the code and, incidentally, does not trigger any event at time = 0.5."	defect	closed	critical	2.0.0	New Instantiation		fixed		
