#96 reinstated the subsref functions in Swigref.m. However, when running the test-suite with recent Octave, it generates lots of warnings like
warning: 'uint64 matrix' object indexed with empty index list
warning: called from
subsref at line 29 column 28
an example is generated at
This turns out to come from the following line in
SwigRef.m (generated
here)
[varargout{1}] = builtin('subsref',self,substruct('.',s.subs,'()',{}));
It is caused by the empty cell-array for (). The warning can be reproduced as follows
a.x=1;
subsref(a,substruct('.','x','()',{}))
This does returns 1 but with the same warning (but is silent in MATLAB).
The simple solution seems to use
[varargout{1}] = builtin('subsref',self,substruct('.',s.subs));
which has the desired effect
#96 reinstated the
subsreffunctions inSwigref.m. However, when running the test-suite with recent Octave, it generates lots of warnings likean example is generated at
swig/Examples/test-suite/matlab/default_args_runme.m
Line 18 in cd3f6c5
This turns out to come from the following line in
SwigRef.m(generated here)[varargout{1}] = builtin('subsref',self,substruct('.',s.subs,'()',{}));It is caused by the empty cell-array for
(). The warning can be reproduced as followsThis does returns 1 but with the same warning (but is silent in MATLAB).
The simple solution seems to use
[varargout{1}] = builtin('subsref',self,substruct('.',s.subs));which has the desired effect