Opened 7 years ago
Closed 7 years ago
#4731 closed defect (fixed)
Issue with each in start attribute binding with the NF
Reported by: | Francesco Casella | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | 2.0.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: |
Description
Please check Modelica.Electrical.Digital.Examples.DFFREG. The compiler reports
[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS/OpenModelica/OMCompiler/build/lib/omlibrary/Modelica 3.2.2/Electrical/Digital.mo:682:63-682:73:writable] Error: Type mismatch in binding fixed = true, expected subtype of Boolean[2, 2], got type Boolean.
From what I understand looking at the model, fixed = true
needs to be applied to an array of 2 elements (not 2x2) by means of a scalar 'each' value.
Change History (5)
follow-up: 2 comment:1 by , 7 years ago
comment:2 by , 7 years ago
Replying to casella:
In fact, I'm not sure the MSL code is correct here:
delay(inertialDelaySensitive(each y(start=L.'U', fixed=true))),shouldn't it rather be
delay(inertialDelaySensitive(y(each start=L.'U', each fixed=true))),
No, the first is correct since inertialDelaySensitive is the array in this case. But yeah, it's not always clear how each
should be used. Both the old and new instantiation is a bit confused about each
actually, and the whole handling of each
probably needs to be redesigned a bit in the new instantiation.
comment:3 by , 7 years ago
Smaller model for this that triggers NF (and also the old one):
model O Real n[2]; end O; model M O o(each n(fixed=true)); end M;
comment:4 by , 7 years ago
This model now passess the FE and breaks much later in the backend (see #4817). I'm not sure if this issue has been solved thoroughly.
comment:5 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
As of yesterday, the error was
which is better (the expected type is correct) but not yet there (some problems with each).
In fact, I'm not sure the MSL code is correct here:
shouldn't it rather be