You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's an issue when trying to index into an array of anonymous structs when the datatype is a struct within a namespace. Not sure if this is SWIG's fault or possibly ICG.
I get the following error when trying to run this unit sim:
Traceback (most recent call last):
File "RUN_test/input.py", line 3, in <module>
filter.control.filters[0].num[0] = [1,2,3,4,5]
TypeError: 'FilterCoeffs' object does not support indexing
Other notes
This code does work when the FilterCoeffs struct isn't in a namespace, or if it's a class. The workaround right now is to not use C-style struct definitions and instead do
structMyType {
// data
};
I messaged Scott about this earlier this year so I thought I'd document it here. It can be a pain to track down.
The text was updated successfully, but these errors were encountered:
There's an issue when trying to index into an array of anonymous structs when the datatype is a struct within a namespace. Not sure if this is SWIG's fault or possibly ICG.
SWIG version: 3.0.12
Trick version: 19.3.1
GCC version: 7.5.0
Example
test.hh
:S_define
:Input file:
Outputs
I get the following error when trying to run this unit sim:
Other notes
This code does work when the
FilterCoeffs
struct isn't in a namespace, or if it's a class. The workaround right now is to not use C-style struct definitions and instead doI messaged Scott about this earlier this year so I thought I'd document it here. It can be a pain to track down.
The text was updated successfully, but these errors were encountered: