[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41723] Local functions in classdef files
From: |
Guillaume |
Subject: |
[Octave-bug-tracker] [bug #41723] Local functions in classdef files |
Date: |
Wed, 5 Apr 2017 06:41:16 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0 |
Follow-up Comment #12, bug #41723 (project octave):
I modified my classdef files to work around bug #50716 and I can confirm
everything works fine so this report can be closed as fixed after pushing
Mike's test case.
I just suggest a slightly modified test using this:
classdef class_bug41723 < handle
properties
value
endproperties
methods
function obj = class_bug41723 ()
obj.value = helper_function ();
endfunction
function val = getval (obj)
val = helper_function_2 ();
endfunction
endmethods
endclassdef
function y = helper_function ()
y = 42;
endfunction
function y = helper_function_2 (in)
if (! nargin)
y = helper_function_2 (true);
else
y = 2 * helper_function ();
endif
endfunction
and add this case:
assert (obj.getval (), 2 * obj.value);
so that it also tests local functions calling themselves or another local
function, as well as being called from a method and not just the constructor.
Many thanks for this!
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?41723>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/