bugGNU Octave - Bugs: bug #56883, inputname() is empty when calling...

 
 

bug #56883: inputname() is empty when calling a classdef method by "dot notation"

Submitter:  Jiawei Wang <jwang>
Submitted:  Thu 12 Sep 2019 08:56:35 AM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Jiawei Wang Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 30 Jan 2024 10:37:33 PM UTC, comment #2: 

This bug is still present with Octave 10.1 development branch.  I made a new version of the test code and uploaded it here.

(file #55645)

Rik <rik5>
Group administrator
Thu 12 Sep 2019 01:56:44 PM UTC, comment #1: 

Thank you for the report.  I can confirm this behavior for the current stable and dev version of Octave.  Interesting is that Matlab R2019a is not able to get the inputname of "pi" at all:


>> obj = some_class();
>> some_method (obj, pi)
[obj]
[]
>> obj.some_method (pi)
[obj]
[]


I modified your method to print both inputnames:


fprintf('[%s]\n', inputname(1));
fprintf('[%s]\n', inputname(2));


Kai Torben Ohlhus <siko1056>
Group Member
Thu 12 Sep 2019 08:56:35 AM UTC, original submission:  

Consider the following class definition

classdef some_class
    methods
        function some_method(obj, x)
            fprintf('[%s]\n', inputname(2));
        end
    end
end

and the commands

obj = some_class();
some_method(obj, pi);
obj.some_method(pi);

gives

[pi]
[]

I think both results should be [pi].

Jiawei Wang <jwang>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #55645:  bug56883.m added by rik5 (351B - 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 (Updated the item)
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by jwang (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-30 rik5 Attached File- Added bug56883.m, #55645
    2024-01-23 mmuetzel CategoryOctave Function Classdef
    2019-09-12 siko1056 StatusNone Confirmed
        Release5.1.0 dev
        Operating SystemMicrosoft Windows Any
        Summaryinputname() returns empty when called in a &quot;dot style&quot; method inputname() is empty when calling a classdef method by "dot notation"

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code