Opened 5 years ago
Closed 5 years ago
#5652 closed defect (invalid)
NF fails to evaluate Integer in if expression
Reported by: | ulrich1a | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | 1.14.0 |
Component: | New Instantiation | Version: | v1.14.0-dev-nightly |
Keywords: | Cc: |
Description
The following model runs fine in OF but fails in NF:
model evalTest Real[2] a; protected parameter Integer X(fixed=false) "fails in equation evaluation"; initial algorithm X:= 1; equation for i in 1:2 loop if X==i then a[i] = 2; else a[i] = 3; end if; end for; end evalTest;
The error message is: Interner Fehler NFCeval.evalRelationEqual failed to evaluate ‘X == 1‘
Change History (4)
comment:1 by , 5 years ago
Component: | *unknown* → New Instantiation |
---|---|
Owner: | changed from | to
comment:2 by , 5 years ago
I am using the following version:
OMEdit v1.14.0-dev.62+g21f82a33
Connected to OMCompiler v1.14.0-dev.269+g5dc61f678
Connected to OMSimulator v2.1.0-dev-148-gd6918bd-linux
I am getting the error with the Additional Translation Flags: -d=initialization -d=aliasConflicts +std=3.3 -d=newInst
I did compile OpenModelica on Debian Stretch a few days ago after pulling the latest commits.
comment:3 by , 5 years ago
I may have to add, that it is required to finish OMEdit after setting the flag -d=newInst and start OMEdit again. Otherwise the flag has no effect.
comment:4 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
I confirm that the problem is resolved if using the latest nightly build.
The version of OMCompiler that you are using dates back to 15 May, and it refers to the repository OpenModelica/OMCompiler which is now obsolete. Starting from mid-may, the OpenModelica source codes, that were previously stored in separate sub-projects, where brought under the OpenModelica/OpenModelica repository.
If you are compiling from sources, please make sure that you are using the latest commit. Otherwise, you can try the latest nightly build.
Such errors should have been fixed several months ago, and I can't reproduce the issue. Which version of OM are you using?