#1298 closed defect (fixed)
Records (and functions) with complex default bindings fail
Reported by: | Martin Sjölund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | critical | Milestone: | 1.16.0 |
Component: | Backend | Version: | |
Keywords: | Cc: | Martin Sjölund, Adrian Pop |
Description (last modified by )
Default bindings that refer to other input variables are not handled correctly. The only testcases that use these features work, but only because the binding is somehow ignored (using default modifications anyway).
package HardMagnetic public constant Real mu_0 = 3; record BaseData parameter Real H_cBRef = 1; parameter Real B_rRef = 1; parameter Real T_ref = 293.15; parameter Real alpha_Br = 0; parameter Real T_op = 293.15; final parameter Real B_r = B_rRef * (1 + alpha_Br * (T_op - T_ref)); final parameter Real H_cB = H_cBRef * (1 + alpha_Br * (T_op - T_ref)); final parameter Real mu_r = B_r / (mu_0 * H_cB); end BaseData; record NdFeB extends HardMagnetic.BaseData(H_cBRef = 900000, B_rRef = 1.2, T_ref = 20 + 273.15, alpha_Br = -0.001); end NdFeB; end HardMagnetic;
Can be handled while elaborating the call (for any parameter that needs a default binding, replace any cref to another input with the expression used for that input). Note that for functions, order matters so these bindings should be sorted already...
Change History (12)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
partially fixed in revsion 6935. it might not work if the final parameters in the
record are not final anymore.
comment:3 by , 10 years ago
Component: | → Backend |
---|---|
Milestone: | Red October → 1.9.3 |
comment:8 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:9 by , 7 years ago
Milestone: | 1.12.0 → Future |
---|
The milestone of this ticket has been reassigned to "Future".
If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.
If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".
In both cases, a short informative comment would be welcome.
comment:10 by , 7 years ago
Description: | modified (diff) |
---|
comment:11 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The ticket isn't quite clear on how to reproduce the issue, but neither the old nor the new frontend seems to have any issues handling HardMagnetic.NdFeB
.
comment:12 by , 4 years ago
Milestone: | Future → 1.16.0 |
---|
Affects the following testcase (which is arelay checked in?!?): libraries/msl31/Modelica.Magnetic.Fluxtubes.mos