Opened 7 years ago
Closed 3 years ago
#4623 closed defect (fixed)
Nested record cannot be used directly in a class.
Reported by: | Owned by: | Per Östlund | |
---|---|---|---|
Priority: | high | Milestone: | 1.19.0 |
Component: | Frontend | Version: | v1.13.0-dev-nightly |
Keywords: | Cc: |
Description
When using a record, which in turns has an array of records, the fields of the records in the array cannot be accessed directly without the Check Model function complaining.
In the example, the record B contains instances of record A. Verbose, is a model which first extracts A from B (field z) and stores in a parameter named hack. Then hack fields (in this case, x) is accessed and stored in another parameter. Bug model in the other hand, access directly x through z, without intermediate variables and Check Model Complains.
Here is the output for each Check model.
[1] 22:54:48 Scripting Notification
Check of RecordUse.Verbose completed successfully.
[1] 22:54:52 Translation Error
Internal error Expression.subscriptExp failed on {{RecordBag.A(0.0, 0.0), RecordBag.A(0.0, 0.0)}, {RecordBag.A(0.0, 0.0), RecordBag.A(0.0, 0.0)}, {RecordBag.A(0.0, 0.0), RecordBag.A(0.0, 0.0)}}
[2] 22:54:52 Scripting Notification
Check of RecordUse.Bug completed successfully.
Attachments (2)
Change History (6)
by , 7 years ago
Attachment: | Example.zip added |
---|
follow-up: 2 comment:1 by , 7 years ago
comment:2 by , 7 years ago
Replying to anonymous:
recordBag uses "package.mo" name with models A and B inside and outside, which probably is invalid.
However OM should either load one A and B models (I'm not sure which one should be) or reject to load this "package.mo" with an error message.
Instead it loads and shows inside the same package two A and two B models, which is invalid.
Sorry about that, somehow I got the code duplicated for each class in the package. I've deleted the rebundant code and updloaded the example again.
comment:3 by , 7 years ago
Component: | *unknown* → Frontend |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:4 by , 3 years ago
Milestone: | Future → 1.19.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
This seems to have been fixed at some point, and now works with both the old and the new frontend.
recordBag uses "package.mo" name with models A and B inside and outside, which probably is invalid.
However OM should either load one A and B models (I'm not sure which one should be) or reject to load this "package.mo" with an error message.
Instead it loads and shows inside the same package two A and two B models, which is invalid.