Opened 5 years ago
Closed 5 years ago
#6117 closed defect (worksforme)
Throwing error for missing else-clause even if condition is parametric
| Reported by: | Owned by: | Adeel Asghar | |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.16.0 |
| Component: | OMEdit | Version: | v1.16.0-dev |
| Keywords: | Cc: |
Description
I get:
Missing else-clause in if-equation with non-parameter conditions
but the condition is parametric!
See example
OpenModelica v1.16.0-dev-275-g033f38916 on Win10
Attachments (2)
Change History (9)
by , 5 years ago
| Attachment: | ElseClauseNonParamter.zip added |
|---|
comment:1 by , 5 years ago
I'm sorry, but I can't open the attached package in OMEdit, I get
[1] 18:38:34 Translation Warning [D:/Temp/OMEdit//ElseClauseNonParamter/package.order: 0:0-0:0]: Found duplicate names in package.order file: readTableData, readTableData. [1] 18:38:58 Translation Notification [ElseClauseNonParamter: 3:7-5:103]: From here: [2] 18:38:58 Translation Error [ElseClauseNonParamter: 6:7-8:103]: An element with name readTableData is already declared in this scope. [3] 18:38:58 Translation Error Class ElseClauseNonParamter.ConstrainedMotionTableCustom2Test_onRecord not found in scope <top>.
Can you please check and update?
comment:2 by , 5 years ago
Sorry, I really don't know how it got corrupted.
Here is the working example
comment:3 by , 5 years ago
| Component: | *unknown* → OMEdit |
|---|---|
| Milestone: | Future → 1.16.0 |
| Owner: | changed from to |
| Priority: | high → critical |
| Status: | new → assigned |
Something fishy is going on with OMEdit, we'll check and report,
@adeas31, when I load the attached package, I get the errors shown above, and if I display the whole package I see
package ElseClauseNonParamter "CrtVehicle Library - Interface definitions and architectures for vehicle system modeling"
import SI = Modelica.SIunits;
function readTableData =
ConstrainedMotionTestPack.Tables.Internal.readTable2DData
"Read table data from text or MATLAB MAT-file";
function readTableData =
ConstrainedMotionTestPack.Tables.Internal.readTable1DData
"Read table data from text or MATLAB MAT-file";
function readTableData =
ConstrainedMotionTestPack.Tables.Internal.readTable1DData
"Read table data from text or MATLAB MAT-file";
annotation(
Protection(showDiagram = true, showText = true, showVariables = true, showDiagnostics = true, showStatistics = true, allowDuplicate = true),
preferredView = "info",
version = "0.1.0",
versionDate = "2017-11-01",
versionBuild = 1,
dateModified = "2018-01-01",
uses(Modelica(version = "3.2.3"), Complex(version = "3.2.3")),
Documentation(info = "<html>
<p>CrtVehicle Library documentation</p>
</html>"));
end ElseClauseNonParamter;
I have no idea where does the thrice-repeated readTableData come from, the package.mo file does not contain it, could you please check?
comment:4 by , 5 years ago
@casella did you actually downloaded the _v2 version?
Because that problem was with the older package, not with the latest.
comment:5 by , 5 years ago
Yes, I did. I double-cheched the .mo files and and the package.order file, and there is no trace of the readTableData function, I have no idea what is going on. Maybe I'm missing something obvious...
comment:6 by , 5 years ago
OK, I was using the recent file option, I though I had the files overwritten but I hadn't.
@adeas31, problem solved.
comment:7 by , 5 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | assigned → closed |
The model works fine with the latest nighly build, please try that.

Minimal Example