bugGNU Octave - Bugs: bug #53601, Class method access lists do not...

 
 

bug #53601: Class method access lists do not need to be cell arrays for single items.

Submitter:  Richard <crobar>
Submitted:  Tue 10 Apr 2018 07:25:57 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Richard Crozier Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 11 Apr 2018 11:47:03 PM UTC, comment #1: 

The check_access function is looking for a string or a cell array of metaclasses.  Another workaround is to put the single metaclass in quotes to make it a string like so


     methods (Access = "?testMethodAccess2")


However, I also modified the function to accept a single metaclass object.  The included example now works.  See http://hg.savannah.gnu.org/hgweb/octave/rev/22ece7843499.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Tue 10 Apr 2018 07:25:57 AM UTC, original submission:  

Matlab allows the class method access list to not be a cell array (or at least not use cell array syntax) if there is a single item. See the attached example.

In the example, running test_octave_method_access_control.m should display
'Access granted' on the command line (and does so in Matlab R2016b). In
Octave it results in the error:


error: invalid property/method access in class `testMethodAccess1'



If the syntax is changed from


     methods (Access = ?testMethodAccess2)


to


     methods (Access = {?testMethodAccess2})


then it works in Octave.


Richard <crobar>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #43867:  testMethodAccess1.m added by crobar (208B - text/x-objcsrc)
file #43868:  testMethodAccess2.m added by crobar (469B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by crobar (Submitted the item)
  • -email is unavailable- added by crobar
  •  

    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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-12 rik5 Open/ClosedOpen Closed
    2018-04-11 rik5 StatusNone Fixed
    2018-04-10 crobar Attached File- Added test_octave_method_access_control.m, #43866
        Attached File- Added testMethodAccess1.m, #43867
        Attached File- Added testMethodAccess2.m, #43868
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code