bugGNU Octave - Bugs: bug #51296, classdef constructor call fails...

 
 

bug #51296: classdef constructor call fails when parentheses are omitted

Submitter:  Mike Miller <mtmiller>
Submitted:  Thu 22 Jun 2017 11:58:27 PM UTC
   
 
Category:  Interpreter Severity:  4 - Important
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 30 Jun 2017 10:42:38 PM UTC, comment #4: 

Also verified that this works now.  Closing report.

Rik <rik5>
Group administrator
Fri 23 Jun 2017 11:29:13 PM UTC, comment #3: 

This works for me now.

Mike Miller <mtmiller>
Group Member
Fri 23 Jun 2017 10:25:21 PM UTC, comment #2: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/ffd27f53fc79

I'm not super happy with this change, but I don't see another way to do it at the moment.  It does seem to work though, and also seems to fix the problem for bug #51295.

John W. Eaton <jwe>
Group administrator
Fri 23 Jun 2017 02:20:35 AM UTC, comment #1: 

I neglected to mention that this applies only to classdef classes that are in a +package directory.


>> p = inputParser;     ## this is fine
>> m = containers.Map;  ## this is not fine


So that makes sense that this is a result of this change related to indexing (see also bug #51152 caused by the same change).

Mike Miller <mtmiller>
Group Member
Thu 22 Jun 2017 11:58:27 PM UTC, original submission:  

Since changeset 551fa3879615 (https://hg.savannah.gnu.org/hgweb/octave/rev/551fa3879615) it's no longer possible to call a classdef constructor without parentheses

Using the containers.Map class that is part of Octave now as an example:


>> m = containers.Map ();
>> keys (m)
ans = {}(1x0)
>> m.keys ()
ans = {}(1x0)
>>
>> m = containers.Map;  ## this should return the same thing
>> m
>> m.keys
error: method `keys' is not static


It looks like "containers.Map" is returning some kind of reference to the class constructor function while "containers.Map()" is calling it correctly. Running "m()" does seem to return a new object.

Mike Miller <mtmiller>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-06-30 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-06-23 jwe StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code