Opened 14 years ago
Last modified 4 years ago
#1298 closed defect
Records (and functions) with complex default bindings fail — at Version 10
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 (10)
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) |
---|
Affects the following testcase (which is arelay checked in?!?): libraries/msl31/Modelica.Magnetic.Fluxtubes.mos