bugGNU Octave - Bugs: bug #51192, static class method argument...

 
 

bug #51192: static class method argument inaccessible

Submitter:  A.R. Burgers <arb>
Submitted:  Tue 06 Jun 2017 08:15:59 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  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

Fri 21 Jul 2017 03:53:04 PM UTC, comment #9: 

I folded the two changesets into one and pushed them here (http://hg.savannah.gnu.org/hgweb/octave/rev/711227992c1d).  Thanks Piotr for tracing this down and then coding a solution.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Fri 21 Jul 2017 12:21:54 AM UTC, comment #8: 

I added the two changsets: 1 with the bugfix and the other with the test and a comment to the bugfix.

Piotr Held <jsoh425>
Thu 20 Jul 2017 11:29:22 PM UTC, comment #7: 

Not only should this get fixed, but we should add a test in the test/ directory for this bug.  See the directory test/bug-44940 for an example.

Rik <rik5>
Group administrator
Thu 20 Jul 2017 05:58:52 PM UTC, comment #6: 

I'm working on this problem and I think I found the culprit. It's line libinterp/parse-tree/pt-eval.cc:1267 in the broken changeset. When you call a static method on an object the 'indexing_object' variable is true, but when you call it on a class name it is false. I am trying to find the fix and will post a changeset once I do.

Piotr Held <jsoh425>
Thu 20 Jul 2017 05:54:27 PM UTC, comment #5: 

I'm adding jwe to the CC list for this report since he was the author of 23521:551fa3879615.  After reading the comments on the check-in, I can believe that it is related.

Rik <rik5>
Group administrator
Thu 20 Jul 2017 12:31:18 AM UTC, comment #4: 

I believe the bug is in changeset 23521:551fa3879615, that is before this changeset static methods work and after it they don't.

Piotr Held <jsoh425>
Fri 16 Jun 2017 08:58:54 PM UTC, comment #3: 

Invoking the static method with help of an instance does still work


cs_instance = cs();
cs_instance.pval(10)
10


A.R. Burgers <arb>
Fri 09 Jun 2017 08:33:15 PM UTC, comment #2: 

Confirmed.

Rik <rik5>
Group administrator
Fri 09 Jun 2017 06:29:54 AM UTC, comment #1: 

the cs classdef is simple and defines just a single static method.


classdef cs
    methods (Static)
        function pval(val)
            disp(val)
        end
    end
end


invoking the static method with cs.pval(10) leads to the 'val' undefined message below in current dev

A.R. Burgers <arb>
Tue 06 Jun 2017 08:15:59 PM UTC, original submission:  

in current dev arguments to static methods are undefined.

with dev:


octave rcs.m
ans = 4.3.0+
ans = 06805aabbdd1+
error: 'val' undefined near line 4 column 11
error: called from
    pval at line 4 column 6
    rcs at line 3 column 1


with stable:


ctave-4.2.1 rcs.m
ans = 4.2.1
ans = 0ada77ed24dd+
 10


A.R. Burgers <arb>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #41270:  test.diff added by jsoh425 (3KiB - text/x-patch - This is the changeset with the tests and comment for the bugfix)
file #41269:  bugfix.diff added by jsoh425 (1003B - text/x-patch - This is the bugfix changeset. I will add the test changset shortly)
file #40865:  cs.m added by arb (85B - application/octet-stream)
file #40866:  rcs.m added by arb (49B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Take a look at cset 23521:551fa3879615)
  • -email is unavailable- added by jsoh425 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by arb (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-21 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-07-21 jsoh425 Attached File- Added test.diff, #41270
    2017-07-20 jsoh425 Attached File- Added bugfix.diff, #41269
    2017-07-20 rik5 Carbon-Copy- Added jwe
    2017-06-09 rik5 StatusNone Confirmed
    2017-06-06 arb Attached File- Added cs.m, #40865
        Attached File- Added rcs.m, #40866

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code