bugGNU Octave - Bugs: bug #55488, Invalid use of colon char as...

 
 

bug #55488: Invalid use of colon char as classdef function's argument when subsref is overwritten

Submitter:  None
Submitted:  Wed 16 Jan 2019 02:03:43 PM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Jonas Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 4.2.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 16 Jan 2019 02:09:54 PM UTC, comment #1: 

with the debugger i found out that the char ':' turns into a magic-colon when builtin('subsref',self,s) is called. Can i avoid that somehow?

Anonymous
Wed 16 Jan 2019 02:03:43 PM UTC, original submission:  

Hi

the following example fails on the strcmp line with:
error: invalid use of colon in function argument list

It doesn't fail without the subsref definition.
Any idea for a workaround?


a = Value([1,2,3,4,5])
a.get(':')




classdef Value < handle
  properties
    value
  end
  methods
    function self = Value(val)
      self.value = val;
    end
    function varargout = subsref(self,s)
      [varargout{1:nargout}] = builtin('subsref',self,s);
    end
    function r = get(self,varargin)
      if strcmp(varargin{1},':')
        disp('hello');
      end
      r = self.value(varargin{1});
    end
  end
end


Jonas

Anonymous

 

(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 mmuetzel (Updated the item)
  • -email is unavailable- added by None (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-23 mmuetzel CategoryInterpreter Classdef
    2019-01-24 mtmiller CategoryNone Interpreter

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code