Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

OM rev13094 seems to have an issue with asserts

OM rev13094 seems to have an issue with asserts

Hello,

I updated to rev13094 and suddenly models with assert statements assert(condition, message); do not simulate any more. There appears the following message:

Error: Variable AssertionLevel.error not found in scope myModel containing the assert statement

After commenting the assert statement the model works again!


In rev12691 everything is working fine.

Anybody else having the same problem?

Thanks, Fritz

Edited by: zav1984 - Sep-29-12 13:15:29

Re: OM rev13094 seems to have an issue with asserts

Hi again current/smile,

just found out that this error message has something to do with encapsulated packages:

try the following test model which is located inside the encapsulated package "OMTest":


Hence assuming a library structure you would have a folder containing

- a file "package.mo":

encapsulated package OMTest "OpenModelica Test Library"

end OMTest;


- and a file "AssertTest.mo":

within OMTest;


model AssertTest

Real x;

equation
  assert(x>1,"message");
 
  x = 10;
 

end AssertTest;

when trying to simulate, following error comes:

Error: Variable AssertionLevel.error not found in scope OMTest.AssertTest
Error: Error occurred while flattening model OMTest.AssertTest

by removing "encapsulated" everything works.

Re: OM rev13094 seems to have an issue with asserts

There are 0 guests and 0 other users also viewing this topic
You are here: