bugGNU Octave - Bugs: bug #51276, private function in classdef file

 
 

bug #51276: private function in classdef file

Submitter:  Guillaume <gyom>
Submitted:  Tue 20 Jun 2017 12:25:03 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Duplicate Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 24 Jun 2017 01:19:14 PM UTC, comment #8: 

Guillaume: I extended your test case. See my comment here: https://savannah.gnu.org/bugs/?45444#comment5

Amro <amro_octave>
Wed 21 Jun 2017 04:09:24 PM UTC, comment #7: 

This is a good test case. I was going to look into adding a similar case to yours for +namespace directories, but that seems to be broken in other ways at the moment.

Mike Miller <mtmiller>
Group Member
Wed 21 Jun 2017 03:44:12 PM UTC, comment #6: 

Thanks, it works now. I attach a test.

(file #41013)

Guillaume <gyom>
Wed 21 Jun 2017 03:34:30 PM UTC, comment #5: 

OK, I backed out my previous changeset and replaced it with this one:

http://hg.savannah.gnu.org/hgweb/octave/rev/2d4a7ae1f6cd

John W. Eaton <jwe>
Group administrator
Wed 21 Jun 2017 08:33:29 AM UTC, comment #4: 

Thanks John!

I started writing a test for this and noticed that a local function cannot call a private function, ie having a local function in myclass.m calling myprivatefcn() fails.
Checking with Matlab, this works, while it is not possible to call a local function from a private function.

Guillaume <gyom>
Tue 20 Jun 2017 09:49:23 PM UTC, comment #3: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/97c3223c17a6

On the other bug report, I also noted that we could use at test for this feature.  Would someone like to add one?

John W. Eaton <jwe>
Group administrator
Tue 20 Jun 2017 04:25:34 PM UTC, comment #2: 

Sorry about this - a search with keywords "classdef" and "private" did not return the report you mention.

Guillaume <gyom>
Tue 20 Jun 2017 03:58:18 PM UTC, comment #1: 

This has been reported previously, see bug #45444. Closing as a duplicate.

Mike Miller <mtmiller>
Group Member
Tue 20 Jun 2017 12:25:03 PM UTC, original submission:  

I was looking at the compatibility of gramm with Octave:
https://github.com/piermorel/gramm/
and noticed a problem with functions defined in a "private" folder:


@myclass/
  myclass.m
  private/
    myprivatefcn.m



classdef myclass

   properties

     prop = []

  end %properties

  methods

    function obj = myclass(varargin)
      myprivatefcn ();
    end %function

  end %methods

end %classdef



function myprivatefcn
  disp('hello');
end %function


The error message is:


octave:2> myclass
error: 'myprivatefcn' undefined near line 13 column 7
error: called from
    myclass at line 13 column 7


As for gramm, it will require matlab.mixin.Copyable...

Guillaume <gyom>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #41013:  bug-51276.tar.gz added by gyom (2KiB - application/gzip)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by amro_octave (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-06-21 gyom Attached File- Added bug-51276.tar.gz, #41013
    2017-06-20 mtmiller StatusNone Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #45444

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code