@@ -865,9 +865,14 @@ algorithm
865865 (exp1::exps) := Expression . flattenArrayExpToList(e);
866866 (cr1, call1) := match exp1
867867 case DAE . CREF (componentRef= cr1) then (cr1, "" );
868- case DAE . CALL (path= Absyn . IDENT (name= "previous" ), expLst= {DAE . CREF (componentRef= cr1)}) then (cr1, "previous" );
868+ case DAE . CALL (path= Absyn . IDENT (name= call1 ), expLst= {DAE . CREF (componentRef= cr1)}) then (cr1, call1 );
869869 else fail();
870870 end match;
871+ if call1 <> "" and Config . simCodeTarget() <> "Cpp" or call1 == "pre" then
872+ // only Cpp runtime supports collapsed calls, except pre(array), see e.g.
873+ // Modelica_Synchronous.Examples.Elementary.RealSignals.SampleWithADeffects
874+ fail();
875+ end if ;
871876 // Check that the first element starts at index [1,...,1]
872877 subs := ComponentReference . crefLastSubs(cr1);
873878 true := ndim== listLength(subs);
@@ -881,7 +886,7 @@ algorithm
881886 // DAE.CREF(componentRef=cr2) := exp;
882887 (cr2, call2) := match exp
883888 case DAE . CREF (componentRef= cr2) then (cr2, "" );
884- case DAE . CALL (path= Absyn . IDENT (name= "previous" ), expLst= {DAE . CREF (componentRef= cr2)}) then (cr2, "previous" );
889+ case DAE . CALL (path= Absyn . IDENT (name= call2 ), expLst= {DAE . CREF (componentRef= cr2)}) then (cr2, call2 );
885890 else fail();
886891 end match;
887892 true := ndim== listLength(ComponentReference . crefLastSubs(cr2));
0 commit comments