[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62420] inputParser fails due to interpreter c
From: |
Georg Wiora |
Subject: |
[Octave-bug-tracker] [bug #62420] inputParser fails due to interpreter changes in 7.1.0 |
Date: |
Fri, 6 May 2022 03:45:06 -0400 (EDT) |
Follow-up Comment #2, bug #62420 (project octave):
Sorry Markus, I had an outdated version of inputParser in my path. After
removing the old version the problem essentially stays the same, just the code
looks exactly as you quoted it.
It fails when executing _val (in)_ because _validatedattributes()_ that is
provided as function handle in _val_ is not returning a result if argument
check is ok:
error: validateattributes: function called with too many outputs
error: called from
validateattributes
After I rewrote the validate_arg() function like this it is behaving as
expected:
function validate_arg (this, name, val, in)
try
check = val(in);
catch
myerror = lasterror();
if strcmpi(myerror.identifier,"Octave:invalid-fun-call")
## check is ok if no result
check = true;
else
## rethrow error
disp(myerror());
error(myerror.identifier,myerror.message);
endif
end_try_catch
if (!check)
this.error (sprintf ("failed validation of %s with %s",
toupper (name), func2str (val)));
endif
this.Results.(name) = in;
endfunction
I can't tell if it would be better to modify _validateattributes()_
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62420>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/